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, std::optional< LibFileFormats::AcidizerTags > &outAcidTags) 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, std::optional< LibFileFormats::AcidizerTags > &acidTags)=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< WaveTrack::HoldermStreams
 

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 706 of file ImportFFmpeg.cpp.

707{
708
709}

Member Function Documentation

◆ Cancel()

void FFmpegImportFileHandle::Cancel ( )
overridevirtual

Implements ImportFileHandle.

Definition at line 554 of file ImportFFmpeg.cpp.

555{
556 if(!mStopped)
557 mCancelled = true;
558}
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 549 of file ImportFFmpeg.cpp.

550{
551 return mName;
552}

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 697 of file ImportFFmpeg.cpp.

698{
699 auto metadata = mAVFormatContext->GetMetadata();
700
701 if (metadata.HasValue(name, DICT_IGNORE_SUFFIX))
702 tags.SetTag(tag, wxString::FromUTF8(std::string(metadata.Get(name, {}, DICT_IGNORE_SUFFIX))));
703}
#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,
std::optional< LibFileFormats::AcidizerTags > &  outAcidTags 
)
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 stream->InsertSilence(0, double(stream_delay) / AUDACITY_AV_TIME_BASE);
496 }
497
498 mStreams.push_back(stream);
499 }
500
501 // This is the heart of the importing process
502
503 // Read frames.
504 for (std::unique_ptr<AVPacketWrapper> packet;
505 (packet = mAVFormatContext->ReadNextPacket()) != nullptr &&
506 !mCancelled && !mStopped;)
507 {
508 // Find a matching StreamContext
509 auto streamContextIt = std::find_if(
510 mStreamContexts.begin(), mStreamContexts.end(),
511 [index = packet->GetStreamIndex()](const StreamContext& ctx)
512 { return ctx.StreamIndex == index;
513 });
514
515 if (streamContextIt == mStreamContexts.end())
516 continue;
517
518 WriteData(&(*streamContextIt), packet.get());
519 if(mProgressLen > 0)
520 progressListener.OnImportProgress(static_cast<double>(mProgressPos) /
521 static_cast<double>(mProgressLen));
522 }
523
524 // Flush the decoders.
525 if (!mStreamContexts.empty() && !mCancelled)
526 {
527 auto emptyPacket = mFFmpeg->CreateAVPacketWrapper();
528
530 WriteData(&sc, emptyPacket.get());
531 }
532
533 if(mCancelled)
534 {
536 return;
537 }
538
539 // Copy audio from mChannels to newly created tracks (destroying mChannels elements in process)
541
542 // Save metadata
543 WriteMetadata(tags);
544 progressListener.OnImportResult(mStopped
547}
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()
const std::shared_ptr< FFmpegFunctions > mFFmpeg
std::vector< WaveTrack::Holder > mStreams
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 std::shared_ptr< WaveTrack > NewWaveTrack(WaveTrackFactory &trackFactory, unsigned nChannels, sampleFormat effectiveFormat, double rate)
Definition: ImportUtils.cpp:35
static void FinalizeImport(TrackHolders &outTracks, const std::vector< std::shared_ptr< WaveTrack > > &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 560 of file ImportFFmpeg.cpp.

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

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 566 of file ImportFFmpeg.cpp.

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

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 665 of file ImportFFmpeg.cpp.

666{
667 Tags temp;
668
669 GetMetadata(temp, TAG_TITLE, "title");
670 GetMetadata(temp, TAG_COMMENTS, "comment");
671 GetMetadata(temp, TAG_ALBUM, "album");
672 GetMetadata(temp, TAG_TRACK, "track");
673 GetMetadata(temp, TAG_GENRE, "genre");
674
675 if (wxString(mAVFormatContext->GetInputFormat()->GetName()).Contains("m4a"))
676 {
677 GetMetadata(temp, TAG_ARTIST, "artist");
678 GetMetadata(temp, TAG_YEAR, "date");
679 }
680 else if (wxString(mAVFormatContext->GetInputFormat()->GetName()).Contains("asf")) /* wma */
681 {
682 GetMetadata(temp, TAG_ARTIST, "artist");
683 GetMetadata(temp, TAG_YEAR, "year");
684 }
685 else
686 {
687 GetMetadata(temp, TAG_ARTIST, "author");
688 GetMetadata(temp, TAG_YEAR, "year");
689 }
690
691 if (!temp.IsEmpty())
692 {
693 *tags = temp;
694 }
695}
#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:282

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<WaveTrack::Holder> 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: