Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
FFmpegImportFileHandle Class Referencefinal

! Does actual import, returned by FFmpegImportPlugin::Open More...

Inheritance diagram for FFmpegImportFileHandle:
[legend]
Collaboration diagram for FFmpegImportFileHandle:
[legend]

Public Member Functions

 FFmpegImportFileHandle (const FilePath &name)
 
 ~FFmpegImportFileHandle ()
 
bool Init ()
 
bool InitCodecs ()
 
TranslatableString GetFileDescription () override
 
ByteCount GetFileUncompressedBytes () override
 
void Import (ImportProgressListener &progressListener, WaveTrackFactory *trackFactory, TrackHolders &outTracks, Tags *tags) override
 
FilePath GetFilename () const override
 
void Cancel () override
 
void Stop () override
 
void WriteData (StreamContext *sc, const AVPacketWrapper *packet)
 
void WriteMetadata (Tags *tags)
 
void GetMetadata (Tags &tags, const wxChar *tag, const char *name)
 
wxInt32 GetStreamCount () override
 
const TranslatableStringsGetStreamInfo () override
 
void SetStreamUsage (wxInt32 StreamID, bool Use) override
 
- Public Member Functions inherited from ImportFileHandle
virtual ~ImportFileHandle ()
 
virtual FilePath GetFilename () const =0
 
virtual TranslatableString GetErrorMessage () const
 
virtual TranslatableString GetFileDescription ()=0
 
virtual ByteCount GetFileUncompressedBytes ()=0
 
virtual wxInt32 GetStreamCount ()=0
 
virtual const TranslatableStringsGetStreamInfo ()=0
 
virtual void SetStreamUsage (wxInt32 StreamID, bool Use)=0
 
virtual void Import (ImportProgressListener &progressListener, WaveTrackFactory *trackFactory, TrackHolders &outTracks, Tags *tags)=0
 
virtual void Cancel ()=0
 
virtual void Stop ()=0
 

Private Attributes

const std::shared_ptr< FFmpegFunctionsmFFmpeg = FFmpegFunctions::Load()
 
std::vector< StreamContextmStreamContexts
 
std::unique_ptr< AVFormatContextWrappermAVFormatContext
 
TranslatableStrings mStreamInfo
 Array of stream descriptions. After Init() and before Import(), same size as mStreamContexts. More...
 
wxInt64 mProgressPos = 0
 Current timestamp, file position or whatever is used as first argument for Update() More...
 
wxInt64 mProgressLen = 1
 Duration, total length or whatever is used as second argument for Update() More...
 
bool mCancelled = false
 True if importing was canceled by user. More...
 
bool mStopped = false
 True if importing was stopped by user. More...
 
const FilePath mName
 
std::vector< TrackListHoldermStreams
 

Additional Inherited Members

- Public Types inherited from ImportFileHandle
using ByteCount = unsigned long long
 

Detailed Description

! Does actual import, returned by FFmpegImportPlugin::Open

An ImportFileHandle for FFmpeg data.

Definition at line 191 of file ImportFFmpeg.cpp.

Constructor & Destructor Documentation

◆ FFmpegImportFileHandle()

FFmpegImportFileHandle::FFmpegImportFileHandle ( const FilePath name)

Definition at line 336 of file ImportFFmpeg.cpp.

337 : mName{ name }
338{
339}
const TranslatableString name
Definition: Distortion.cpp:76

◆ ~FFmpegImportFileHandle()

FFmpegImportFileHandle::~FFmpegImportFileHandle ( )

Definition at line 707 of file ImportFFmpeg.cpp.

708{
709
710}

Member Function Documentation

◆ Cancel()

void FFmpegImportFileHandle::Cancel ( )
overridevirtual

Implements ImportFileHandle.

Definition at line 555 of file ImportFFmpeg.cpp.

556{
557 if(!mStopped)
558 mCancelled = true;
559}
bool mStopped
True if importing was stopped by user.
bool mCancelled
True if importing was canceled by user.

References mCancelled, and mStopped.

◆ GetFileDescription()

TranslatableString FFmpegImportFileHandle::GetFileDescription ( )
overridevirtual

Implements ImportFileHandle.

Definition at line 439 of file ImportFFmpeg.cpp.

440{
441 return DESC;
442}
#define DESC

References DESC.

◆ GetFilename()

FilePath FFmpegImportFileHandle::GetFilename ( ) const
overridevirtual

Implements ImportFileHandle.

Definition at line 550 of file ImportFFmpeg.cpp.

551{
552 return mName;
553}

References mName.

◆ GetFileUncompressedBytes()

auto FFmpegImportFileHandle::GetFileUncompressedBytes ( )
overridevirtual

Implements ImportFileHandle.

Definition at line 445 of file ImportFFmpeg.cpp.

446{
447 // TODO: Get Uncompressed byte count.
448 return 0;
449}

◆ GetMetadata()

void FFmpegImportFileHandle::GetMetadata ( Tags tags,
const wxChar *  tag,
const char *  name 
)

! Retrieves metadata from FFmpeg and converts to wxString

Parameters
avf- file context \ tags - Audacity tags object \ tag - name of tag to set \ name - name of metadata item to retrieve

Definition at line 698 of file ImportFFmpeg.cpp.

699{
700 auto metadata = mAVFormatContext->GetMetadata();
701
702 if (metadata.HasValue(name, DICT_IGNORE_SUFFIX))
703 tags.SetTag(tag, wxString::FromUTF8(std::string(metadata.Get(name, {}, DICT_IGNORE_SUFFIX))));
704}
#define DICT_IGNORE_SUFFIX
std::unique_ptr< AVFormatContextWrapper > mAVFormatContext
void SetTag(const wxString &name, const wxString &value, const bool bSpecialTag=false)
Definition: Tags.cpp:431

References DICT_IGNORE_SUFFIX, mAVFormatContext, name, and Tags::SetTag().

Referenced by WriteMetadata().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStreamCount()

wxInt32 FFmpegImportFileHandle::GetStreamCount ( )
inlineoverridevirtual

! Called by Import.cpp

Returns
number of readable streams in the file

Implements ImportFileHandle.

Definition at line 238 of file ImportFFmpeg.cpp.

239 {
240 return static_cast<wxInt32>(mStreamContexts.size());
241 }
std::vector< StreamContext > mStreamContexts

References mStreamContexts.

◆ GetStreamInfo()

const TranslatableStrings & FFmpegImportFileHandle::GetStreamInfo ( )
inlineoverridevirtual

! Called by Import.cpp

Returns
array of strings - descriptions of the streams

Implements ImportFileHandle.

Definition at line 245 of file ImportFFmpeg.cpp.

246 {
247 return mStreamInfo;
248 }
TranslatableStrings mStreamInfo
Array of stream descriptions. After Init() and before Import(), same size as mStreamContexts.

References mStreamInfo.

◆ Import()

void FFmpegImportFileHandle::Import ( ImportProgressListener progressListener,
WaveTrackFactory trackFactory,
TrackHolders outTracks,
Tags tags 
)
overridevirtual

This may break the correspondence with mStreamInfo

TODO: Nag FFmpeg devs about start_time until they finally say WHAT is this and HOW to handle it.

Implements ImportFileHandle.

Definition at line 451 of file ImportFFmpeg.cpp.

455{
456 outTracks.clear();
457 mCancelled = false;
458 mStopped = false;
459
461 mStreamContexts.erase (std::remove_if (mStreamContexts.begin (), mStreamContexts.end (), [](const StreamContext& ctx) {
462 return !ctx.Use;
463 }), mStreamContexts.end());
464
465 for(unsigned s = 0; s < mStreamContexts.size(); ++s)
466 {
467 const StreamContext& sc = mStreamContexts[s];
468
469 auto stream = ImportUtils::NewWaveTrack(
470 *trackFactory,
472 sc.SampleFormat,
473 sc.CodecContext->GetSampleRate()
474 );
475
476 // Handles the start_time by creating silence. This may or may not be correct.
477 // There is a possibility that we should ignore first N milliseconds of audio instead. I do not know.
479
480 int64_t stream_delay = 0;
481
482 const int64_t streamStartTime =
483 mAVFormatContext->GetStream(sc.StreamIndex)->GetStartTime();
484
486 {
487 stream_delay = streamStartTime;
488
489 wxLogDebug(
490 wxT("Stream %d start_time = %lld, that would be %f milliseconds."),
491 s, (long long)streamStartTime, double(streamStartTime) / 1000);
492 }
493
494 if (stream_delay > 0) {
495 for (auto track : *stream)
496 track->InsertSilence(0, double(stream_delay) / AUDACITY_AV_TIME_BASE);
497 }
498
499 mStreams.push_back(std::move(stream));
500 }
501
502 // This is the heart of the importing process
503
504 // Read frames.
505 for (std::unique_ptr<AVPacketWrapper> packet;
506 (packet = mAVFormatContext->ReadNextPacket()) != nullptr &&
507 !mCancelled && !mStopped;)
508 {
509 // Find a matching StreamContext
510 auto streamContextIt = std::find_if(
511 mStreamContexts.begin(), mStreamContexts.end(),
512 [index = packet->GetStreamIndex()](const StreamContext& ctx)
513 { return ctx.StreamIndex == index;
514 });
515
516 if (streamContextIt == mStreamContexts.end())
517 continue;
518
519 WriteData(&(*streamContextIt), packet.get());
520 if(mProgressLen > 0)
521 progressListener.OnImportProgress(static_cast<double>(mProgressPos) /
522 static_cast<double>(mProgressLen));
523 }
524
525 // Flush the decoders.
526 if (!mStreamContexts.empty() && !mCancelled)
527 {
528 auto emptyPacket = mFFmpeg->CreateAVPacketWrapper();
529
531 WriteData(&sc, emptyPacket.get());
532 }
533
534 if(mCancelled)
535 {
537 return;
538 }
539
540 // Copy audio from mChannels to newly created tracks (destroying mChannels elements in process)
542
543 // Save metadata
544 WriteMetadata(tags);
545 progressListener.OnImportResult(mStopped
548}
wxT("CloseDown"))
#define AUDACITY_AV_TIME_BASE
Definition: FFmpegTypes.h:80
#define AUDACITY_AV_NOPTS_VALUE
Definition: FFmpegTypes.h:74
void WriteData(StreamContext *sc, const AVPacketWrapper *packet)
wxInt64 mProgressPos
Current timestamp, file position or whatever is used as first argument for Update()
std::vector< TrackListHolder > mStreams
const std::shared_ptr< FFmpegFunctions > mFFmpeg
void WriteMetadata(Tags *tags)
wxInt64 mProgressLen
Duration, total length or whatever is used as second argument for Update()
virtual void OnImportResult(ImportResult result)=0
Used to report on import result for file handle passed as argument to OnImportFileOpened.
virtual void OnImportProgress(double progress)=0
static TrackListHolder NewWaveTrack(WaveTrackFactory &trackFactory, unsigned nChannels, sampleFormat effectiveFormat, double rate)
Definition: ImportUtils.cpp:35
static void FinalizeImport(TrackHolders &outTracks, const std::vector< TrackListHolder > &importedStreams)
Flushes the given channels and moves them to outTracks.
Definition: ImportUtils.cpp:49
std::unique_ptr< AVCodecContextWrapper > CodecContext
sampleFormat SampleFormat

References AUDACITY_AV_NOPTS_VALUE, AUDACITY_AV_TIME_BASE, ImportProgressListener::Cancelled, StreamContext::CodecContext, ImportUtils::FinalizeImport(), StreamContext::InitialChannels, mAVFormatContext, mCancelled, mFFmpeg, mProgressLen, mProgressPos, mStopped, mStreamContexts, mStreams, ImportUtils::NewWaveTrack(), ImportProgressListener::OnImportProgress(), ImportProgressListener::OnImportResult(), StreamContext::SampleFormat, ImportProgressListener::Stopped, StreamContext::StreamIndex, anonymous_namespace{MIDIPlay.cpp}::streamStartTime, ImportProgressListener::Success, WriteData(), WriteMetadata(), and wxT().

Here is the call graph for this function:

◆ Init()

bool FFmpegImportFileHandle::Init ( )

! Format initialization

Returns
true if successful, false otherwise

Definition at line 341 of file ImportFFmpeg.cpp.

342{
343 if (!mFFmpeg)
344 return false;
345
346 mAVFormatContext = mFFmpeg->CreateAVFormatContext();
347
348 const auto err = mAVFormatContext->OpenInputContext(mName, nullptr, AVDictionaryWrapper(*mFFmpeg));
349
351 {
352 wxLogError(wxT("FFmpeg : AVFormatContextWrapper::OpenInputContext() failed for file %s"), mName);
353 return false;
354 }
355
356 if (!InitCodecs())
357 return false;
358
359 return true;
360}

References InitCodecs(), mAVFormatContext, mFFmpeg, mName, AVIOContextWrapper::Success, and wxT().

Here is the call graph for this function:

◆ InitCodecs()

bool FFmpegImportFileHandle::InitCodecs ( )

! Codec initialization

Returns
true if successful, false otherwise

Definition at line 362 of file ImportFFmpeg.cpp.

363{
364 for (unsigned int i = 0; i < mAVFormatContext->GetStreamsCount(); i++)
365 {
366 const AVStreamWrapper* stream = mAVFormatContext->GetStream(i);
367
368 if (stream->IsAudio())
369 {
370 const AVCodecIDFwd id = mAVFormatContext->GetStream(i)->GetAVCodecID();
371
372 auto codec = mFFmpeg->CreateDecoder(id);
373 auto name = mFFmpeg->avcodec_get_name(id);
374
375 if (codec == NULL)
376 {
377 wxLogError(
378 wxT("FFmpeg : CreateDecoder() failed. Index[%02d], Codec[%02x - %s]"),
379 i, id, name);
380 //FFmpeg can't decode this stream, skip it
381 continue;
382 }
383
384 auto codecContextPtr = stream->GetAVCodecContext();
385
386 if ( codecContextPtr->Open( codecContextPtr->GetCodec() ) < 0 )
387 {
388 wxLogError(wxT("FFmpeg : Open() failed. Index[%02d], Codec[%02x - %s]"),i,id,name);
389 //Can't open decoder - skip this stream
390 continue;
391 }
392
393 const int channels = codecContextPtr->GetChannels();
394 const sampleFormat preferredFormat =
395 codecContextPtr->GetPreferredAudacitySampleFormat();
396
397 auto codecContext = codecContextPtr.get();
398
399 mStreamContexts.emplace_back(
400 StreamContext { stream->GetIndex(), std::move(codecContextPtr),
401 channels, preferredFormat, true });
402
403 // Stream is decodeable and it is audio. Add it and its description to the arrays
404 int duration = 0;
405 if (stream->GetDuration() > 0)
406 duration = stream->GetDuration() * stream->GetTimeBase().num / stream->GetTimeBase().den;
407 else
408 duration = mAVFormatContext->GetDuration() / AUDACITY_AV_TIME_BASE;
409
410 wxString bitrate;
411 if (codecContext->GetBitRate() > 0)
412 bitrate.Printf(wxT("%d"),(int)codecContext->GetBitRate());
413 else
414 bitrate.Printf(wxT("?"));
415
416 AVDictionaryWrapper streamMetadata = stream->GetMetadata();
417
418 auto lang = std::string(streamMetadata.Get("language", {}));
419
420 auto strinfo = XO(
421/* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
422"Index[%02x] Codec[%s], Language[%s], Bitrate[%s], Channels[%d], Duration[%d]")
423 .Format(
424 stream->GetIndex(),
425 name,
426 lang,
427 bitrate,
428 (int)codecContext->GetChannels(),
429 (int)duration);
430
431 mStreamInfo.push_back(strinfo);
432 }
433 //for video and unknown streams do nothing
434 }
435 //It doesn't really returns false, but GetStreamCount() will return 0 if file is composed entirely of unreadable streams
436 return true;
437}
int AVCodecIDFwd
Definition: AVCodecID.h:407
XO("Cut/Copy/Paste")
sampleFormat
The ordering of these values with operator < agrees with the order of increasing bit width.
Definition: SampleFormat.h:30
std::string_view Get(const std::string_view &key, const std::string_view &defaultValue, int flags=0) const
virtual int64_t GetDuration() const noexcept=0
virtual int GetIndex() const noexcept=0
virtual bool IsAudio() const noexcept=0
virtual AVDictionaryWrapper GetMetadata() const noexcept=0
virtual AudacityAVRational GetTimeBase() const noexcept=0
virtual std::unique_ptr< AVCodecContextWrapper > GetAVCodecContext() const noexcept=0
int den
denominator
Definition: FFmpegTypes.h:139
int num
numerator
Definition: FFmpegTypes.h:138

References AUDACITY_AV_TIME_BASE, AudacityAVRational::den, AVDictionaryWrapper::Get(), AVStreamWrapper::GetAVCodecContext(), AVStreamWrapper::GetDuration(), AVStreamWrapper::GetIndex(), AVStreamWrapper::GetMetadata(), AVStreamWrapper::GetTimeBase(), AVStreamWrapper::IsAudio(), mAVFormatContext, mFFmpeg, mStreamContexts, mStreamInfo, name, AudacityAVRational::num, wxT(), and XO().

Referenced by Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStreamUsage()

void FFmpegImportFileHandle::SetStreamUsage ( wxInt32  StreamID,
bool  Use 
)
inlineoverridevirtual

! Called by Import.cpp

Parameters
StreamID- index of the stream in mStreamInfo and mStreamContexts
Use- true if this stream should be imported, false otherwise

Implements ImportFileHandle.

Definition at line 253 of file ImportFFmpeg.cpp.

254 {
255 if (StreamID < static_cast<wxInt32>(mStreamContexts.size()))
256 mStreamContexts[StreamID].Use = Use;
257 }

References mStreamContexts.

◆ Stop()

void FFmpegImportFileHandle::Stop ( )
overridevirtual

Implements ImportFileHandle.

Definition at line 561 of file ImportFFmpeg.cpp.

562{
563 if(!mCancelled)
564 mStopped = true;
565}

References mCancelled, and mStopped.

◆ WriteData()

void FFmpegImportFileHandle::WriteData ( StreamContext sc,
const AVPacketWrapper packet 
)

! Writes decoded data into WaveTracks.

Parameters
sc- stream context

Definition at line 567 of file ImportFFmpeg.cpp.

568{
569 // Find the stream in mStreamContexts array
570 auto streamIt = std::find_if(
571 mStreamContexts.begin(),
572 mStreamContexts.end(),
573 [&](StreamContext& context) { return sc == &context; }
574 );
575
576 // Stream is not found. This should not really happen
577 if (streamIt == mStreamContexts.end())
578 {
579 //VS: Shouldn't this mean import failure?
580 return;
581 }
582 auto stream = mStreams[std::distance(mStreamContexts.begin(), streamIt)];
583
584 const auto nChannels = std::min(sc->CodecContext->GetChannels(), sc->InitialChannels);
585
586 // Write audio into WaveTracks
587 if (sc->SampleFormat == int16Sample)
588 {
589 auto data = sc->CodecContext->DecodeAudioPacketInt16(packet);
590 const auto channelsCount = sc->CodecContext->GetChannels();
591 const auto samplesPerChannel = data.size() / channelsCount;
592
593 unsigned chn = 0;
594 ImportUtils::ForEachChannel(*stream, [&](auto& channel)
595 {
596 if(chn >= nChannels)
597 return;
598
599 channel.AppendBuffer(
600 reinterpret_cast<samplePtr>(data.data() + chn),
601 sc->SampleFormat,
602 samplesPerChannel,
603 sc->CodecContext->GetChannels(),
604 sc->SampleFormat
605 );
606 ++chn;
607 });
608 }
609 else if (sc->SampleFormat == floatSample)
610 {
611 auto data = sc->CodecContext->DecodeAudioPacketFloat(packet);
612 const auto channelsCount = sc->CodecContext->GetChannels();
613 const auto samplesPerChannel = data.size() / channelsCount;
614
615 auto channelIndex = 0;
616 ImportUtils::ForEachChannel(*stream, [&](auto& channel)
617 {
618 if(channelIndex >= nChannels)
619 return;
620
621 channel.AppendBuffer(
622 reinterpret_cast<samplePtr>(data.data() + channelIndex),
623 sc->SampleFormat,
624 samplesPerChannel,
625 sc->CodecContext->GetChannels(),
626 sc->SampleFormat
627 );
628 ++channelIndex;
629 });
630 }
631 const AVStreamWrapper* avStream = mAVFormatContext->GetStream(sc->StreamIndex);
632
633 int64_t filesize = mFFmpeg->avio_size(mAVFormatContext->GetAVIOContext()->GetWrappedValue());
634 // PTS (presentation time) is the proper way of getting current position
635 if (
638 {
639 auto timeBase = avStream->GetTimeBase();
640
642 packet->GetPresentationTimestamp() * timeBase.num / timeBase.den;
643
645 (mAVFormatContext->GetDuration() > 0 ?
646 mAVFormatContext->GetDuration() / AUDACITY_AV_TIME_BASE :
647 1);
648 }
649 // When PTS is not set, use number of frames and number of current frame
650 else if (
651 avStream->GetFramesCount() > 0 && sc->CodecContext->GetFrameNumber() > 0 &&
652 sc->CodecContext->GetFrameNumber() <= avStream->GetFramesCount())
653 {
654 mProgressPos = sc->CodecContext->GetFrameNumber();
655 mProgressLen = avStream->GetFramesCount();
656 }
657 // When number of frames is unknown, use position in file
658 else if (
659 filesize > 0 && packet->GetPos() > 0 && packet->GetPos() <= filesize)
660 {
661 mProgressPos = packet->GetPos();
662 mProgressLen = filesize;
663 }
664}
int min(int a, int b)
char * samplePtr
Definition: SampleFormat.h:55
virtual int64_t GetPos() const noexcept=0
virtual int64_t GetPresentationTimestamp() const noexcept=0
virtual int64_t GetFramesCount() const noexcept=0
static void ForEachChannel(TrackList &trackList, const std::function< void(WaveChannel &)> &op)
Iterates over channels in each wave track from the list.
Definition: ImportUtils.cpp:66

References AUDACITY_AV_NOPTS_VALUE, AUDACITY_AV_TIME_BASE, StreamContext::CodecContext, floatSample, ImportUtils::ForEachChannel(), AVStreamWrapper::GetFramesCount(), AVPacketWrapper::GetPos(), AVPacketWrapper::GetPresentationTimestamp(), AVStreamWrapper::GetTimeBase(), StreamContext::InitialChannels, int16Sample, mAVFormatContext, mFFmpeg, min(), mProgressLen, mProgressPos, mStreamContexts, mStreams, StreamContext::SampleFormat, and StreamContext::StreamIndex.

Referenced by Import().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteMetadata()

void FFmpegImportFileHandle::WriteMetadata ( Tags tags)

! Writes extracted metadata to tags object

Parameters
avf- file context \ tags - Audacity tags object

Definition at line 666 of file ImportFFmpeg.cpp.

667{
668 Tags temp;
669
670 GetMetadata(temp, TAG_TITLE, "title");
671 GetMetadata(temp, TAG_COMMENTS, "comment");
672 GetMetadata(temp, TAG_ALBUM, "album");
673 GetMetadata(temp, TAG_TRACK, "track");
674 GetMetadata(temp, TAG_GENRE, "genre");
675
676 if (wxString(mAVFormatContext->GetInputFormat()->GetName()).Contains("m4a"))
677 {
678 GetMetadata(temp, TAG_ARTIST, "artist");
679 GetMetadata(temp, TAG_YEAR, "date");
680 }
681 else if (wxString(mAVFormatContext->GetInputFormat()->GetName()).Contains("asf")) /* wma */
682 {
683 GetMetadata(temp, TAG_ARTIST, "artist");
684 GetMetadata(temp, TAG_YEAR, "year");
685 }
686 else
687 {
688 GetMetadata(temp, TAG_ARTIST, "author");
689 GetMetadata(temp, TAG_YEAR, "year");
690 }
691
692 if (!temp.IsEmpty())
693 {
694 *tags = temp;
695 }
696}
#define TAG_TRACK
Definition: Tags.h:61
#define TAG_COMMENTS
Definition: Tags.h:64
#define TAG_GENRE
Definition: Tags.h:63
#define TAG_ALBUM
Definition: Tags.h:60
#define TAG_YEAR
Definition: Tags.h:62
#define TAG_TITLE
Definition: Tags.h:58
#define TAG_ARTIST
Definition: Tags.h:59
void GetMetadata(Tags &tags, const wxChar *tag, const char *name)
ID3 Tags (for MP3)
Definition: Tags.h:73
bool IsEmpty()
Definition: Tags.cpp:287

References GetMetadata(), Tags::IsEmpty(), mAVFormatContext, TAG_ALBUM, TAG_ARTIST, TAG_COMMENTS, TAG_GENRE, TAG_TITLE, TAG_TRACK, and TAG_YEAR.

Referenced by Import().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mAVFormatContext

std::unique_ptr<AVFormatContextWrapper> FFmpegImportFileHandle::mAVFormatContext
private

Definition at line 266 of file ImportFFmpeg.cpp.

Referenced by GetMetadata(), Import(), Init(), InitCodecs(), WriteData(), and WriteMetadata().

◆ mCancelled

bool FFmpegImportFileHandle::mCancelled = false
private

True if importing was canceled by user.

Definition at line 273 of file ImportFFmpeg.cpp.

Referenced by Cancel(), Import(), and Stop().

◆ mFFmpeg

const std::shared_ptr<FFmpegFunctions> FFmpegImportFileHandle::mFFmpeg = FFmpegFunctions::Load()
private

Definition at line 262 of file ImportFFmpeg.cpp.

Referenced by Import(), Init(), InitCodecs(), and WriteData().

◆ mName

const FilePath FFmpegImportFileHandle::mName
private

Definition at line 275 of file ImportFFmpeg.cpp.

Referenced by GetFilename(), and Init().

◆ mProgressLen

wxInt64 FFmpegImportFileHandle::mProgressLen = 1
private

Duration, total length or whatever is used as second argument for Update()

Definition at line 271 of file ImportFFmpeg.cpp.

Referenced by Import(), and WriteData().

◆ mProgressPos

wxInt64 FFmpegImportFileHandle::mProgressPos = 0
private

Current timestamp, file position or whatever is used as first argument for Update()

Definition at line 270 of file ImportFFmpeg.cpp.

Referenced by Import(), and WriteData().

◆ mStopped

bool FFmpegImportFileHandle::mStopped = false
private

True if importing was stopped by user.

Definition at line 274 of file ImportFFmpeg.cpp.

Referenced by Cancel(), Import(), and Stop().

◆ mStreamContexts

std::vector<StreamContext> FFmpegImportFileHandle::mStreamContexts
private

Definition at line 264 of file ImportFFmpeg.cpp.

Referenced by GetStreamCount(), Import(), InitCodecs(), SetStreamUsage(), and WriteData().

◆ mStreamInfo

TranslatableStrings FFmpegImportFileHandle::mStreamInfo
private

Array of stream descriptions. After Init() and before Import(), same size as mStreamContexts.

Definition at line 268 of file ImportFFmpeg.cpp.

Referenced by GetStreamInfo(), and InitCodecs().

◆ mStreams

std::vector<TrackListHolder> FFmpegImportFileHandle::mStreams
private

Definition at line 276 of file ImportFFmpeg.cpp.

Referenced by Import(), and WriteData().


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