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< 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}
wxString name
Definition: TagsEditor.cpp:166

◆ ~FFmpegImportFileHandle()

FFmpegImportFileHandle::~FFmpegImportFileHandle ( )

Definition at line 710 of file ImportFFmpeg.cpp.

711{
712
713}

Member Function Documentation

◆ Cancel()

void FFmpegImportFileHandle::Cancel ( )
overridevirtual

Implements ImportFileHandle.

Definition at line 558 of file ImportFFmpeg.cpp.

559{
560 if(!mStopped)
561 mCancelled = true;
562}
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 553 of file ImportFFmpeg.cpp.

554{
555 return mName;
556}

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

702{
703 auto metadata = mAVFormatContext->GetMetadata();
704
705 if (metadata.HasValue(name, DICT_IGNORE_SUFFIX))
706 tags.SetTag(tag, wxString::FromUTF8(std::string(metadata.Get(name, {}, DICT_IGNORE_SUFFIX))));
707}
#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
470 auto tracks = trackFactory->CreateMany(sc.InitialChannels, format, sc.CodecContext->GetSampleRate());
471
472
473 // Handles the start_time by creating silence. This may or may not be correct.
474 // There is a possibility that we should ignore first N milliseconds of audio instead. I do not know.
476
477 int64_t stream_delay = 0;
478
479 const int64_t streamStartTime =
480 mAVFormatContext->GetStream(sc.StreamIndex)->GetStartTime();
481
483 {
484 stream_delay = streamStartTime;
485
486 wxLogDebug(
487 wxT("Stream %d start_time = %lld, that would be %f milliseconds."),
488 s, (long long)streamStartTime, double(streamStartTime) / 1000);
489 }
490 if (stream_delay > 0)
491 {
492 for (auto track : *tracks)
493 {
494 track->InsertSilence(0, double(stream_delay) / AUDACITY_AV_TIME_BASE);
495 }
496 }
497
498 mStreams.push_back(tracks);
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 mStreams to newly created tracks (destroying mStreams elements in process)
540 for (auto& stream : mStreams)
541 {
542 ImportUtils::FinalizeImport(outTracks, std::move(*stream));
543 }
544 mStreams.clear();
545
546 // Save metadata
547 WriteMetadata(tags);
548 progressListener.OnImportResult(mStopped
551}
wxT("CloseDown"))
#define AUDACITY_AV_TIME_BASE
Definition: FFmpegTypes.h:80
#define AUDACITY_AV_NOPTS_VALUE
Definition: FFmpegTypes.h:74
const auto tracks
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 sampleFormat ChooseFormat(sampleFormat effectiveFormat)
Choose appropriate format, which will not be narrower than the specified one.
Definition: ImportUtils.cpp:19
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
TrackListHolder CreateMany(size_t nChannels)
Creates tracks with project's default rate and format and the given number of channels.
Definition: WaveTrack.cpp:423
std::unique_ptr< AVCodecContextWrapper > CodecContext
sampleFormat SampleFormat

References AUDACITY_AV_NOPTS_VALUE, AUDACITY_AV_TIME_BASE, ImportProgressListener::Cancelled, ImportUtils::ChooseFormat(), StreamContext::CodecContext, WaveTrackFactory::CreateMany(), ImportUtils::FinalizeImport(), anonymous_namespace{ExportPCM.cpp}::format, StreamContext::InitialChannels, mAVFormatContext, mCancelled, mFFmpeg, mProgressLen, mProgressPos, mStopped, mStreamContexts, mStreams, ImportProgressListener::OnImportProgress(), ImportProgressListener::OnImportResult(), StreamContext::SampleFormat, ImportProgressListener::Stopped, StreamContext::StreamIndex, anonymous_namespace{MIDIPlay.cpp}::streamStartTime, ImportProgressListener::Success, tracks, 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 564 of file ImportFFmpeg.cpp.

565{
566 if(!mCancelled)
567 mStopped = true;
568}

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

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

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