Ticket #3326: 3326-dvb-radio-v1.patch
File 3326-dvb-radio-v1.patch, 8.7 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
24 24 #include "cc708decoder.h" 25 25 #include "interactivetv.h" 26 26 #include "DVDRingBuffer.h" 27 #include "audiooutputbase.h" 27 28 28 29 #ifdef USING_XVMC 29 30 #include "videoout_xv.h" … … 2681 2682 } 2682 2683 } 2683 2684 2685 // documented in decoderbase.h 2684 2686 bool AvFormatDecoder::GetFrame(int onlyvideo) 2685 2687 { 2686 2688 AVPacket *pkt = NULL; … … 2704 2706 2705 2707 bool skipaudio = (lastvpts == 0); 2706 2708 2709 bool has_video = true; 2710 if (ic->cur_pmt_sect) 2711 { 2712 const PESPacket pes = PESPacket::ViewData(ic->cur_pmt_sect); 2713 const PSIPTable psip(pes); 2714 const ProgramMapTable pmt(psip); 2715 2716 has_video = false; 2717 for (uint i = 0; i < pmt.StreamCount(); i++) 2718 { 2719 // MythTV remaps OpenCable Video to normal video during recording 2720 // so "dvb" is the safest choice for system info type, since this 2721 // will ignore other uses of the same stream id in DVB countries. 2722 has_video |= pmt.IsVideo(i, "dvb"); 2723 } 2724 } 2725 2726 //cerr<<"GetFrame("<<onlyvideo<<") has_video: "<<has_video; 2727 2728 if (!has_video && (onlyvideo >= 0)) 2729 { 2730 VideoFrame *frame = GetNVP()->GetNextVideoFrame(true); 2731 if (frame) 2732 { 2733 clear(frame, GUID_YV12_PLANAR); 2734 unsigned int ysize = frame->width * frame->height; 2735 for (uint i = 0; i < ysize; i++) 2736 { 2737 *(frame->buf + frame->offsets[0] + i) = 2738 (framesPlayed+i) & 0xff; 2739 } 2740 2741 frame->interlaced_frame = 0; // not interlaced 2742 frame->top_field_first = 1; // top field first 2743 frame->repeat_pict = 0; // not a repeated picture 2744 frame->frameNumber = framesPlayed; 2745 2746 GetNVP()->ReleaseNextVideoFrame(frame, lastvpts); 2747 2748 if (GetNVP()->getVideoOutput()) 2749 { 2750 GetNVP()->getVideoOutput()->DeLimboFrame(frame); 2751 if (!GetNVP()->getVideoOutput()->EnoughPrebufferedFrames()) 2752 allowedquit = true; 2753 } 2754 2755 decoded_video_frame = frame; 2756 gotvideo = 1; 2757 framesPlayed++; 2758 } 2759 onlyvideo = -1; 2760 skipaudio = false; 2761 } 2762 2763 uint deadmancounter = 0; 2764 2707 2765 while (!allowedquit) 2708 2766 { 2709 if ((onlyvideo == 0) && 2767 //cerr<<"."; 2768 if ((onlyvideo == 0) && has_video && 2710 2769 ((currentTrack[kTrackTypeAudio] < 0) || 2711 2770 (selectedTrack[kTrackTypeAudio].av_stream_index < 0))) 2712 2771 { 2713 2772 // disable audio request if there are no audio streams anymore 2773 cerr<<"disabling audio"; 2714 2774 onlyvideo = 1; 2715 2775 } 2716 2776 … … 2780 2840 //cout << "behind: " << lastapts << " " << lastvpts << endl; 2781 2841 storevideoframes = true; 2782 2842 } 2783 else 2843 else if (onlyvideo >= 0) 2784 2844 { 2845 //cerr<<"got video -- set allowedquit"<<endl; 2785 2846 allowedquit = true; 2786 2847 continue; 2787 2848 } … … 3013 3074 { 3014 3075 case CODEC_TYPE_AUDIO: 3015 3076 { 3077 deadmancounter++; 3078 3016 3079 bool reselectAudioTrack = false; 3017 3080 3018 3081 // detect switches between stereo and dual languages … … 3056 3119 lastapts = (long long)(av_q2d(curstream->time_base) * 3057 3120 pkt->pts * 1000); 3058 3121 3059 if ( onlyvideo != 0|| (pkt->stream_index != audIdx))3122 if ((onlyvideo > 0) || (pkt->stream_index != audIdx)) 3060 3123 { 3061 3124 ptr += len; 3062 3125 len = 0; … … 3142 3205 GetNVP()->AddAudioData((char *)audioSamples, data_size, 3143 3206 temppts); 3144 3207 3208 AudioOutputBase *audio = dynamic_cast<AudioOutputBase*> 3209 (GetNVP()->getAudioOutput()); 3210 3211 if ((onlyvideo < 0) && 3212 (!audio || 3213 ((audio->getBufferedOnSoundcard() == 0) || 3214 (audio->getSpaceOnSoundcard() < 3215 audio->getBufferedOnSoundcard())))) 3216 { 3217 allowedquit = (onlyvideo < 0); 3218 //if (onlyvideo < 0) 3219 // cerr<<"audio -- set allowedquit"<<endl; 3220 } 3221 3222 if ((onlyvideo < 0) && deadmancounter > 10) 3223 { 3224 cerr<<"BUG: dead man counter triggered"<<endl; 3225 allowedquit = true; 3226 } 3227 3145 3228 if (ringBuffer->InDVDMenuOrStillFrame()) 3146 3229 allowedquit = true; 3147 3230 … … 3395 3478 if (pkt) 3396 3479 delete pkt; 3397 3480 3481 //cerr<<endl; 3398 3482 return true; 3399 3483 } 3400 3484 -
libs/libmythtv/decoderbase.h
70 70 virtual void SetDisablePassThrough(bool disable) { (void)disable; } 71 71 72 72 virtual void setWatchingRecording(bool mode); 73 /// Decode a frame of video/audio. If onlyvideo is +1, 74 /// decodes the video portion, if it is -1 only decodes 75 /// the audio portion, if it is 0 it decodes audio and video 73 76 virtual bool GetFrame(int onlyvideo) = 0; 74 77 NuppelVideoPlayer *GetNVP() { return m_parent; } 75 78 -
libs/libmythtv/libmythtv.pro
14 14 INCLUDEPATH += ../libmythlivemedia/groupsock/include 15 15 INCLUDEPATH += ../libmythlivemedia/liveMedia/include 16 16 INCLUDEPATH += ../libmythlivemedia/UsageEnvironment/include 17 INCLUDEPATH += ../libmythsoundtouch 17 18 18 19 DEPENDPATH += ../libmyth ../libavcodec ../libavformat ../libavutil 19 20 DEPENDPATH += ../libmythmpeg2 ../libmythdvdnav -
libs/libmythtv/hdhrrecorder.cpp
273 273 if (tspacket.HasPayload()) 274 274 { 275 275 const unsigned int lpid = tspacket.PID(); 276 277 if ((GetStreamData()->VideoPIDSingleProgram() == 0xffffffff) && 278 _wait_for_keyframe_option) 279 { 280 _wait_for_keyframe_option = false; 281 } 282 276 283 // Pass or reject frames based on PID, and parse info from them 277 284 if (lpid == GetStreamData()->VideoPIDSingleProgram()) 278 285 { -
libs/libmythtv/mpeg/mpegstreamdata.cpp
15 15 #include "atscstreamdata.h" 16 16 #include "atsctables.h" 17 17 18 #define DEBUG_MPEG_RADIO // uncomment to strip video streams from TS stream 19 18 20 void init_sections(sections_t §, uint last_section) 19 21 { 20 22 static const unsigned char init_bits[8] = … … 554 556 audioPIDs.push_back(pid); 555 557 } 556 558 559 #ifdef DEBUG_MPEG_RADIO 557 560 if (is_video) 561 continue; 562 #endif // DEBUG_MPEG_RADIO 563 564 if (is_video) 558 565 { 559 566 video_cnt++; 560 567 videoPIDs.push_back(pid); -
libs/libmythtv/avformatdecoder.h
94 94 char testbuf[kDecoderProbeBufferSize], 95 95 int testbufsize = kDecoderProbeBufferSize); 96 96 97 /// Decode a frame of video/audio. If onlyvideo is set,98 /// just decode the video portion.99 97 bool GetFrame(int onlyvideo); 100 98 101 99 bool isLastFrameKey(void) { return false; } -
libs/libmyth/audiooutputbase.h
77 77 virtual bool OpenDevice(void) = 0; 78 78 virtual void CloseDevice(void) = 0; 79 79 virtual void WriteAudio(unsigned char *aubuf, int size) = 0; 80 public: 80 81 virtual int getSpaceOnSoundcard(void) = 0; 81 82 virtual int getBufferedOnSoundcard(void) = 0; 82 83 virtual int GetVolumeChannel(int channel) = 0; // Returns 0-100