Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CDVDDemuxFFmpeg Class Reference

#include <DVDDemuxFFmpeg.h>

Inheritance diagram for CDVDDemuxFFmpeg:
CDVDDemux

Public Member Functions

 CDVDDemuxFFmpeg ()
 
 ~CDVDDemuxFFmpeg () override
 
bool Open (const std::shared_ptr< CDVDInputStream > &pInput, bool fileinfo)
 
void Dispose ()
 
bool Reset () override
 
void Flush () override
 
void Abort () override
 
void SetSpeed (int iSpeed) override
 
std::string GetFileName () override
 
DemuxPacketRead () override
 
DemuxPacketReadInternal (bool keep)
 
bool SeekTime (double time, bool backwards=false, double *startpts=NULL) override
 
bool SeekByte (int64_t pos)
 
int GetStreamLength () override
 
CDemuxStreamGetStream (int iStreamId) const override
 Finds stream based on unique id.
 
std::vector< CDemuxStream * > GetStreams () const override
 
int GetNrOfStreams () const override
 
int GetPrograms (std::vector< ProgramInfo > &programs) override
 
void SetProgram (int progId) override
 
bool SeekChapter (int chapter, double *startpts=NULL) override
 
int GetChapterCount () override
 
int GetChapter () override
 
void GetChapterName (std::string &strChapterName, int chapterIdx=-1) override
 
int64_t GetChapterPos (int chapterIdx=-1) override
 
std::string GetStreamCodecName (int iStreamId) override
 
bool Aborted ()
 
- Public Member Functions inherited from CDVDDemux
 CDVDDemux ()
 
virtual ~CDVDDemux ()=default
 
virtual void FillBuffer (bool mode)
 
virtual CDemuxStreamGetStream (int64_t demuxerId, int iStreamId) const
 
int GetNrOfSubtitleStreams ()
 
virtual std::string GetStreamCodecName (int64_t demuxerId, int iStreamId)
 
virtual void EnableStream (int64_t demuxerId, int id, bool enable)
 
virtual void OpenStream (int64_t demuxerId, int id)
 
virtual void SetVideoResolution (unsigned int width, unsigned int height)
 
int64_t GetDemuxerId ()
 

Public Attributes

AVFormatContext * m_pFormatContext
 
std::shared_ptr< CDVDInputStreamm_pInput
 

Protected Member Functions

CDemuxStreamAddStream (int streamIdx)
 
void AddStream (int streamIdx, CDemuxStream *stream)
 Adds or updates a demux stream based in ffmpeg id.
 
void CreateStreams (unsigned int program=UINT_MAX)
 
void DisposeStreams ()
 
void ParsePacket (AVPacket *pkt)
 
TRANSPORT_STREAM_STATE TransportStreamAudioState ()
 
TRANSPORT_STREAM_STATE TransportStreamVideoState ()
 
bool IsTransportStreamReady ()
 
void ResetVideoStreams ()
 
AVDictionary * GetFFMpegOptionsFromInput ()
 
double ConvertTimestamp (int64_t pts, int den, int num)
 
bool IsProgramChange ()
 
unsigned int HLSSelectProgram ()
 
std::string GetStereoModeFromMetadata (AVDictionary *pMetadata)
 
std::string ConvertCodecToInternalStereoMode (const std::string &mode, const StereoModeConversionMap *conversionMap)
 
void GetL16Parameters (int &channels, int &samplerate)
 
double SelectAspect (AVStream *st, bool &forced)
 
StreamHdrType DetermineHdrType (AVStream *pStream)
 
- Protected Member Functions inherited from CDVDDemux
virtual void EnableStream (int id, bool enable)
 
virtual void OpenStream (int id)
 
int GetNrOfStreams (StreamType streamType)
 

Protected Attributes

CCriticalSection m_critSection
 
std::map< int, CDemuxStream * > m_streams
 
std::map< int, std::unique_ptr< CDemuxParserFFmpeg > > m_parsers
 
AVIOContext * m_ioContext
 
double m_currentPts
 
bool m_bMatroska
 
bool m_bAVI
 
bool m_bSup
 
int m_speed
 
unsigned int m_program
 
unsigned int m_streamsInProgram
 
unsigned int m_newProgram
 
unsigned int m_initialProgramNumber
 
int m_seekStream
 
XbmcThreads::EndTime m_timeout
 
struct { 
 
   AVPacket   pkt 
 
   int   result 
 
m_pkt 
 
bool m_streaminfo
 
bool m_reopen = false
 
bool m_checkTransportStream
 
int m_displayTime = 0
 
double m_dtsAtDisplayTime
 
bool m_seekToKeyFrame = false
 
double m_startTime = 0
 
- Protected Attributes inherited from CDVDDemux
int64_t m_demuxerId
 

Friends

class CDemuxStreamAudioFFmpeg
 
class CDemuxStreamVideoFFmpeg
 
class CDemuxStreamSubtitleFFmpeg
 

Constructor & Destructor Documentation

◆ CDVDDemuxFFmpeg()

CDVDDemuxFFmpeg::CDVDDemuxFFmpeg ( )

◆ ~CDVDDemuxFFmpeg()

CDVDDemuxFFmpeg::~CDVDDemuxFFmpeg ( )
override

Member Function Documentation

◆ Abort()

void CDVDDemuxFFmpeg::Abort ( )
overridevirtual

Reimplemented from CDVDDemux.

◆ Aborted()

bool CDVDDemuxFFmpeg::Aborted ( )

◆ AddStream() [1/2]

CDemuxStream * CDVDDemuxFFmpeg::AddStream ( int streamIdx)
protected
Todo
: temporary font file management should be completely removed, by sending font data to the subtitle renderer and using libass ass_add_font to add the fonts directly in memory.

@FIXME: Matroska v4 support BCP-47 language code with LanguageIETF element that have the priority over the Language element, but this is not currently implemented in to ffmpeg library. Since ffmpeg read only the Language element all tracks will be identified with same language (of Language element). As workaround to allow set the right language code we provide the possibility to set the language code in the title field, this allow to kodi to recognize the right language and select the right track to be played at playback starts.

◆ AddStream() [2/2]

void CDVDDemuxFFmpeg::AddStream ( int streamIdx,
CDemuxStream * stream )
protected

Adds or updates a demux stream based in ffmpeg id.

◆ ConvertCodecToInternalStereoMode()

std::string CDVDDemuxFFmpeg::ConvertCodecToInternalStereoMode ( const std::string & mode,
const StereoModeConversionMap * conversionMap )
protected

◆ ConvertTimestamp()

double CDVDDemuxFFmpeg::ConvertTimestamp ( int64_t pts,
int den,
int num )
protected

◆ CreateStreams()

void CDVDDemuxFFmpeg::CreateStreams ( unsigned int program = UINT_MAX)
protected

◆ DetermineHdrType()

StreamHdrType CDVDDemuxFFmpeg::DetermineHdrType ( AVStream * pStream)
protected

◆ Dispose()

void CDVDDemuxFFmpeg::Dispose ( )

◆ DisposeStreams()

void CDVDDemuxFFmpeg::DisposeStreams ( )
protected

◆ Flush()

void CDVDDemuxFFmpeg::Flush ( )
overridevirtual

Implements CDVDDemux.

◆ GetChapter()

int CDVDDemuxFFmpeg::GetChapter ( )
overridevirtual

Reimplemented from CDVDDemux.

◆ GetChapterCount()

int CDVDDemuxFFmpeg::GetChapterCount ( )
overridevirtual

Reimplemented from CDVDDemux.

◆ GetChapterName()

void CDVDDemuxFFmpeg::GetChapterName ( std::string & strChapterName,
int chapterIdx = -1 )
overridevirtual

Reimplemented from CDVDDemux.

◆ GetChapterPos()

int64_t CDVDDemuxFFmpeg::GetChapterPos ( int chapterIdx = -1)
overridevirtual

Reimplemented from CDVDDemux.

◆ GetFFMpegOptionsFromInput()

AVDictionary * CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput ( )
protected

◆ GetFileName()

std::string CDVDDemuxFFmpeg::GetFileName ( )
overridevirtual

Reimplemented from CDVDDemux.

◆ GetL16Parameters()

void CDVDDemuxFFmpeg::GetL16Parameters ( int & channels,
int & samplerate )
protected

◆ GetNrOfStreams()

int CDVDDemuxFFmpeg::GetNrOfStreams ( ) const
overridevirtual

Implements CDVDDemux.

◆ GetPrograms()

int CDVDDemuxFFmpeg::GetPrograms ( std::vector< ProgramInfo > & programs)
overridevirtual

Reimplemented from CDVDDemux.

◆ GetStereoModeFromMetadata()

std::string CDVDDemuxFFmpeg::GetStereoModeFromMetadata ( AVDictionary * pMetadata)
protected

◆ GetStream()

CDemuxStream * CDVDDemuxFFmpeg::GetStream ( int iStreamId) const
overridevirtual

Finds stream based on unique id.

Implements CDVDDemux.

◆ GetStreamCodecName()

std::string CDVDDemuxFFmpeg::GetStreamCodecName ( int iStreamId)
overridevirtual

Reimplemented from CDVDDemux.

◆ GetStreamLength()

int CDVDDemuxFFmpeg::GetStreamLength ( )
overridevirtual

Reimplemented from CDVDDemux.

◆ GetStreams()

std::vector< CDemuxStream * > CDVDDemuxFFmpeg::GetStreams ( ) const
overridevirtual

Implements CDVDDemux.

◆ HLSSelectProgram()

unsigned int CDVDDemuxFFmpeg::HLSSelectProgram ( )
protected

◆ IsProgramChange()

bool CDVDDemuxFFmpeg::IsProgramChange ( )
protected

◆ IsTransportStreamReady()

bool CDVDDemuxFFmpeg::IsTransportStreamReady ( )
protected

◆ Open()

bool CDVDDemuxFFmpeg::Open ( const std::shared_ptr< CDVDInputStream > & pInput,
bool fileinfo )

◆ ParsePacket()

void CDVDDemuxFFmpeg::ParsePacket ( AVPacket * pkt)
protected

◆ Read()

DemuxPacket * CDVDDemuxFFmpeg::Read ( )
overridevirtual

Implements CDVDDemux.

◆ ReadInternal()

DemuxPacket * CDVDDemuxFFmpeg::ReadInternal ( bool keep)

◆ Reset()

bool CDVDDemuxFFmpeg::Reset ( )
overridevirtual

Implements CDVDDemux.

◆ ResetVideoStreams()

void CDVDDemuxFFmpeg::ResetVideoStreams ( )
protected

◆ SeekByte()

bool CDVDDemuxFFmpeg::SeekByte ( int64_t pos)

◆ SeekChapter()

bool CDVDDemuxFFmpeg::SeekChapter ( int chapter,
double * startpts = NULL )
overridevirtual

Reimplemented from CDVDDemux.

◆ SeekTime()

bool CDVDDemuxFFmpeg::SeekTime ( double time,
bool backwards = false,
double * startpts = NULL )
overridevirtual

Implements CDVDDemux.

◆ SelectAspect()

double CDVDDemuxFFmpeg::SelectAspect ( AVStream * st,
bool & forced )
protected

◆ SetProgram()

void CDVDDemuxFFmpeg::SetProgram ( int progId)
overridevirtual

Reimplemented from CDVDDemux.

◆ SetSpeed()

void CDVDDemuxFFmpeg::SetSpeed ( int iSpeed)
overridevirtual

Reimplemented from CDVDDemux.

◆ TransportStreamAudioState()

TRANSPORT_STREAM_STATE CDVDDemuxFFmpeg::TransportStreamAudioState ( )
protected

◆ TransportStreamVideoState()

TRANSPORT_STREAM_STATE CDVDDemuxFFmpeg::TransportStreamVideoState ( )
protected

Friends And Related Symbol Documentation

◆ CDemuxStreamAudioFFmpeg

friend class CDemuxStreamAudioFFmpeg
friend

◆ CDemuxStreamSubtitleFFmpeg

friend class CDemuxStreamSubtitleFFmpeg
friend

◆ CDemuxStreamVideoFFmpeg

friend class CDemuxStreamVideoFFmpeg
friend

Member Data Documentation

◆ m_bAVI

bool CDVDDemuxFFmpeg::m_bAVI
protected

◆ m_bMatroska

bool CDVDDemuxFFmpeg::m_bMatroska
protected

◆ m_bSup

bool CDVDDemuxFFmpeg::m_bSup
protected

◆ m_checkTransportStream

bool CDVDDemuxFFmpeg::m_checkTransportStream
protected

◆ m_critSection

CCriticalSection CDVDDemuxFFmpeg::m_critSection
protected

◆ m_currentPts

double CDVDDemuxFFmpeg::m_currentPts
protected

◆ m_displayTime

int CDVDDemuxFFmpeg::m_displayTime = 0
protected

◆ m_dtsAtDisplayTime

double CDVDDemuxFFmpeg::m_dtsAtDisplayTime
protected

◆ m_initialProgramNumber

unsigned int CDVDDemuxFFmpeg::m_initialProgramNumber
protected

◆ m_ioContext

AVIOContext* CDVDDemuxFFmpeg::m_ioContext
protected

◆ m_newProgram

unsigned int CDVDDemuxFFmpeg::m_newProgram
protected

◆ m_parsers

std::map<int, std::unique_ptr<CDemuxParserFFmpeg> > CDVDDemuxFFmpeg::m_parsers
protected

◆ m_pFormatContext

AVFormatContext* CDVDDemuxFFmpeg::m_pFormatContext

◆ m_pInput

std::shared_ptr<CDVDInputStream> CDVDDemuxFFmpeg::m_pInput

◆ [struct]

struct { ... } CDVDDemuxFFmpeg::m_pkt

◆ m_program

unsigned int CDVDDemuxFFmpeg::m_program
protected

◆ m_reopen

bool CDVDDemuxFFmpeg::m_reopen = false
protected

◆ m_seekStream

int CDVDDemuxFFmpeg::m_seekStream
protected

◆ m_seekToKeyFrame

bool CDVDDemuxFFmpeg::m_seekToKeyFrame = false
protected

◆ m_speed

int CDVDDemuxFFmpeg::m_speed
protected

◆ m_startTime

double CDVDDemuxFFmpeg::m_startTime = 0
protected

◆ m_streaminfo

bool CDVDDemuxFFmpeg::m_streaminfo
protected

◆ m_streams

std::map<int, CDemuxStream*> CDVDDemuxFFmpeg::m_streams
protected

◆ m_streamsInProgram

unsigned int CDVDDemuxFFmpeg::m_streamsInProgram
protected

◆ m_timeout

XbmcThreads::EndTime CDVDDemuxFFmpeg::m_timeout
protected

◆ pkt

AVPacket CDVDDemuxFFmpeg::pkt

◆ result

int CDVDDemuxFFmpeg::result

The documentation for this class was generated from the following files: