Audacity  3.0.3
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 
17 struct FFmpegFunctions;
19 typedef struct AVStream AVStream;
20 typedef struct AVCodecContext AVCodecContext;
21 
23 
24 class FFMPEG_SUPPORT_API AVStreamWrapper
25 {
26 public:
27  AVStreamWrapper(const AVStreamWrapper&) = delete;
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 protected:
76  const FFmpegFunctions& mFFmpeg;
77  AVStream* mAVStream { nullptr };
78 };
AVCodecContext
Definition: ffmpeg-2.3.6-single-header.h:2847
AVDictionaryWrapper
Definition: AVDictionaryWrapper.h:24
AudacityAVRational
Definition: FFmpegTypes.h:132
AVCodecIDFwd
int AVCodecIDFwd
Definition: AVCodecID.h:407
AVStreamWrapper::operator=
AVStreamWrapper & operator=(AVStreamWrapper &)=delete
AVStreamWrapper::AVStreamWrapper
AVStreamWrapper(AVStreamWrapper &&)=delete
AVDiscardFwd
int AVDiscardFwd
Definition: FFmpegTypes.h:128
AVCodecContextWrapper
Definition: AVCodecContextWrapper.h:30
FFmpegFunctions
Definition: FFmpegFunctions.h:85
AVStreamWrapper::operator=
AVStreamWrapper & operator=(AVStreamWrapper &&)=delete
AVSampleFormatFwd
int AVSampleFormatFwd
Definition: FFmpegTypes.h:127
AVStreamWrapper::AVStreamWrapper
AVStreamWrapper(const AVStreamWrapper &)=delete
AVStream
Definition: ffmpeg-2.3.6-single-header.h:4372
FFmpegTypes.h
AVStreamWrapper
Definition: AVStreamWrapper.h:25