1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
/**********************************************************************
Audacity: A Digital Audio Editor
AVStreamWrapper.h
Dmitry Vedenko
**********************************************************************/
#pragma once
#include <memory>
#include "FFmpegTypes.h"
struct FFmpegFunctions;
class AVDictionaryWrapper;
typedef struct AVStream AVStream;
typedef struct AVCodecContext AVCodecContext;
class AVCodecContextWrapper;
class FFMPEG_SUPPORT_API AVStreamWrapper
{
public:
AVStreamWrapper(const AVStreamWrapper&) = delete;
AVStreamWrapper& operator=(AVStreamWrapper&) = delete;
AVStreamWrapper(AVStreamWrapper&&) = delete;
AVStreamWrapper& operator=(AVStreamWrapper&&) = delete;
AVStreamWrapper(const FFmpegFunctions& ffmpeg, AVStream* wrapped) noexcept;
AVStream* GetWrappedValue() noexcept;
const AVStream* GetWrappedValue() const noexcept;
virtual ~AVStreamWrapper() = default;
virtual int GetIndex() const noexcept = 0;
virtual int GetId() const noexcept = 0;
virtual void SetId(int id) noexcept = 0;
virtual AudacityAVRational GetTimeBase() const noexcept = 0;
virtual void SetTimeBase(AudacityAVRational time_base) noexcept = 0;
virtual int64_t GetStartTime() const noexcept = 0;
virtual void SetStartTime(int64_t start_time) noexcept = 0;
virtual int64_t GetDuration() const noexcept = 0;
virtual void SetDuration(int64_t duration) noexcept = 0;
virtual int64_t GetFramesCount() const noexcept = 0;
virtual void SetFramesCount(int64_t nb_frames) noexcept = 0;
virtual int GetDisposition() const noexcept = 0;
virtual void SetDisposition(int disposition) noexcept = 0;
virtual AVSampleFormatFwd GetDiscard() const noexcept = 0;
virtual void SetDiscard(AVDiscardFwd discard) noexcept = 0;
virtual AudacityAVRational GetSampleAspectRatio() const noexcept = 0;
virtual void SetSampleAspectRatio(AudacityAVRational sample_aspect_ratio) noexcept = 0;
virtual AVDictionaryWrapper GetMetadata() const noexcept = 0;
virtual void SetMetadata(AVDictionaryWrapper metadata) noexcept = 0;
virtual bool IsAudio() const noexcept = 0;
virtual AVCodecIDFwd GetAVCodecID() const noexcept = 0;
virtual std::unique_ptr<AVCodecContextWrapper> GetAVCodecContext() const noexcept = 0;
virtual int SetParametersFromContext(AVCodecContextWrapper& context) noexcept = 0;
protected:
const FFmpegFunctions& mFFmpeg;
AVStream* mAVStream { nullptr };
};
|