Warning, file /include/opencascade/Media_Frame.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _Media_Frame_HeaderFile
0016 #define _Media_Frame_HeaderFile
0017
0018 #include <NCollection_Vec2.hxx>
0019 #include <Standard_TypeDef.hxx>
0020 #include <Image_PixMap.hxx>
0021 #include <Standard_Transient.hxx>
0022 #include <Standard_Type.hxx>
0023
0024 struct AVFrame;
0025
0026
0027 class Media_Frame : public Standard_Transient
0028 {
0029 DEFINE_STANDARD_RTTIEXT(Media_Frame, Standard_Transient)
0030 public:
0031
0032 Standard_EXPORT static Image_Format FormatFFmpeg2Occt(int theFormat);
0033
0034
0035
0036 Standard_EXPORT static int FormatOcct2FFmpeg(Image_Format theFormat);
0037
0038
0039 Standard_EXPORT static void Swap(const occ::handle<Media_Frame>& theFrame1,
0040 const occ::handle<Media_Frame>& theFrame2);
0041
0042 public:
0043
0044 Standard_EXPORT Media_Frame();
0045
0046
0047 Standard_EXPORT ~Media_Frame() override;
0048
0049
0050 Standard_EXPORT bool IsEmpty() const;
0051
0052
0053 Standard_EXPORT void Unref();
0054
0055
0056 NCollection_Vec2<int> Size() const { return NCollection_Vec2<int>(SizeX(), SizeY()); }
0057
0058
0059 Standard_EXPORT int SizeX() const;
0060
0061
0062 Standard_EXPORT int SizeY() const;
0063
0064
0065 Standard_EXPORT int Format() const;
0066
0067
0068 Standard_EXPORT bool IsFullRangeYUV() const;
0069
0070
0071 Standard_EXPORT uint8_t* Plane(int thePlaneId) const;
0072
0073
0074 Standard_EXPORT int LineSize(int thePlaneId) const;
0075
0076
0077 Standard_EXPORT int64_t BestEffortTimestamp() const;
0078
0079
0080 const AVFrame* Frame() const { return myFrame; }
0081
0082
0083 AVFrame* ChangeFrame() { return myFrame; }
0084
0085
0086 double Pts() const { return myFramePts; }
0087
0088
0089 void SetPts(double thePts) { myFramePts = thePts; }
0090
0091
0092 float PixelAspectRatio() const { return myPixelRatio; }
0093
0094
0095 void SetPixelAspectRatio(float theRatio) { myPixelRatio = theRatio; }
0096
0097
0098 bool IsLocked() const { return myIsLocked; }
0099
0100
0101 void SetLocked(bool theToLock) { myIsLocked = theToLock; }
0102
0103 public:
0104
0105 Standard_EXPORT bool InitWrapper(const occ::handle<Image_PixMap>& thePixMap);
0106
0107 protected:
0108 AVFrame* myFrame;
0109 double myFramePts;
0110 float myPixelRatio;
0111 bool myIsLocked;
0112 };
0113
0114 #endif