- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp
r12693 r13041 62 62 { 63 63 avdevice_register_all(); 64 64 65 65 OSG_NOTICE<<"Attempting to stream "<<filename<<std::endl; 66 66 … … 77 77 formatParams.width = 640; 78 78 formatParams.height = 480; 79 #endif 79 #endif 80 80 formatParams.time_base.num = 1; 81 81 formatParams.time_base.den = 30; … … 83 83 std::string format = "video4linux2"; 84 84 iformat = av_find_input_format(format.c_str()); 85 85 86 86 if (iformat) 87 87 { … … 121 121 throw std::runtime_error("av_open_input_file() failed"); 122 122 } 123 123 124 124 m_format_context.reset(p_format_context); 125 125 … … 160 160 return false; 161 161 } 162 162 163 163 return true; 164 164 } … … 170 170 flushAudioQueue(); 171 171 flushVideoQueue(); 172 172 173 173 m_audio_decoder.close(waitForThreadToExit); 174 174 m_video_decoder.close(waitForThreadToExit); … … 213 213 } 214 214 215 void FFmpegDecoder::seek(double time) 215 void FFmpegDecoder::seek(double time) 216 216 { 217 217 m_pending_packet.clear(); … … 222 222 } 223 223 224 void FFmpegDecoder::pause() 224 void FFmpegDecoder::pause() 225 225 { 226 226 m_pending_packet.clear(); … … 318 318 throw std::runtime_error("av_dup_packet() failed"); 319 319 320 m_pending_packet = FFmpegPacket(packet); 320 m_pending_packet = FFmpegPacket(packet); 321 321 } 322 322 } … … 360 360 return false; 361 361 } 362 362 363 363 364 364 … … 389 389 } 390 390 391 bool FFmpegDecoder::readNextPacketSeeking() 391 bool FFmpegDecoder::readNextPacketSeeking() 392 392 { 393 393 const FFmpegPacket packet(FFmpegPacket::PACKET_FLUSH); … … 396 396 m_state = NORMAL; 397 397 398 return false; 398 return false; 399 399 } 400 400 … … 412 412 413 413 m_clocks.seek(time); 414 m_state = SEEKING; 414 m_state = SEEKING; 415 415 } 416 416
