12 #include "threads/CriticalSection.h" 13 #include "threads/SystemClock.h" 19 #include <libavformat/avformat.h> 25 enum class TRANSPORT_STREAM_STATE
36 std::string GetStreamName()
override;
38 std::string m_description;
40 AVStream* m_stream =
nullptr;
47 std::string GetStreamName()
override;
49 std::string m_description;
52 AVStream* m_stream =
nullptr;
60 std::string GetStreamName()
override;
62 std::string m_description;
65 AVStream* m_stream =
nullptr;
72 AVCodecParserContext* m_parserCtx =
nullptr;
73 AVCodecContext* m_codecCtx =
nullptr;
76 #define FFMPEG_DVDNAV_BUFFER_SIZE 2048 // for dvd's 86 bool Open(
const std::shared_ptr<CDVDInputStream>& pInput,
bool fileinfo);
88 bool Reset()
override ;
89 void Flush()
override;
90 void Abort()
override;
91 void SetSpeed(
int iSpeed)
override;
92 std::string GetFileName()
override;
96 bool SeekTime(
double time,
bool backwards =
false,
double* startpts = NULL)
override;
97 bool SeekByte(int64_t
pos);
98 int GetStreamLength()
override;
100 std::vector<CDemuxStream*> GetStreams()
const override;
101 int GetNrOfStreams()
const override;
102 int GetPrograms(std::vector<ProgramInfo>& programs)
override;
103 void SetProgram(
int progId)
override;
105 bool SeekChapter(
int chapter,
double* startpts = NULL)
override;
106 int GetChapterCount()
override;
107 int GetChapter()
override;
108 void GetChapterName(std::string& strChapterName,
int chapterIdx=-1)
override;
109 int64_t GetChapterPos(
int chapterIdx = -1)
override;
110 std::string GetStreamCodecName(
int iStreamId)
override;
114 AVFormatContext* m_pFormatContext;
115 std::shared_ptr<CDVDInputStream> m_pInput;
124 void CreateStreams(
unsigned int program = UINT_MAX);
125 void DisposeStreams();
126 void ParsePacket(AVPacket* pkt);
127 TRANSPORT_STREAM_STATE TransportStreamAudioState();
128 TRANSPORT_STREAM_STATE TransportStreamVideoState();
129 bool IsTransportStreamReady();
130 void ResetVideoStreams();
131 AVDictionary* GetFFMpegOptionsFromInput();
132 double ConvertTimestamp(int64_t pts,
int den,
int num);
133 void UpdateCurrentPTS();
134 bool IsProgramChange();
135 unsigned int HLSSelectProgram();
137 std::string GetStereoModeFromMetadata(AVDictionary* pMetadata);
138 std::string ConvertCodecToInternalStereoMode(
const std::string& mode,
const StereoModeConversionMap* conversionMap);
140 void GetL16Parameters(
int& channels,
int& samplerate);
141 double SelectAspect(AVStream* st,
bool& forced);
143 StreamHdrType DetermineHdrType(AVStream* pStream);
145 CCriticalSection m_critSection;
146 std::map<int, CDemuxStream*> m_streams;
147 std::map<int, std::unique_ptr<CDemuxParserFFmpeg>> m_parsers;
149 AVIOContext* m_ioContext;
156 unsigned int m_program;
157 unsigned int m_streamsInProgram;
158 unsigned int m_newProgram;
159 unsigned int m_initialProgramNumber;
174 bool m_reopen =
false;
175 bool m_checkTransportStream;
176 int m_displayTime = 0;
177 double m_dtsAtDisplayTime;
178 bool m_seekToKeyFrame =
false;
179 double m_startTime = 0;
Definition: DVDDemux.h:219
Definition: DVDDemuxFFmpeg.h:68
Definition: SystemClock.h:31
Definition: DVDDemux.h:155
Definition: DVDDemuxFFmpeg.h:80
Definition: DVDDemux.h:124
Definition: DVDDemuxFFmpeg.h:43
Definition: DVDDemuxFFmpeg.cpp:66
Definition: DVDDemuxFFmpeg.h:55
Definition: DVDDemux.h:183
Definition: LibInputPointer.h:13
Definition: DVDDemuxFFmpeg.h:32
Definition: DVDDemux.h:70
Definition: DemuxPacket.h:22