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