Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Media_Packet.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created by: Kirill GAVRILOV
0002 // Copyright (c) 2019 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _Media_Packet_HeaderFile
0016 #define _Media_Packet_HeaderFile
0017 
0018 #include <Standard_Transient.hxx>
0019 #include <Standard_Type.hxx>
0020 
0021 struct AVPacket;
0022 
0023 //! AVPacket wrapper - the packet (data chunk for decoding/encoding) holder.
0024 class Media_Packet : public Standard_Transient
0025 {
0026   DEFINE_STANDARD_RTTIEXT(Media_Packet, Standard_Transient)
0027 public:
0028   //! Empty constructor
0029   Standard_EXPORT Media_Packet();
0030 
0031   //! Destructor.
0032   Standard_EXPORT virtual ~Media_Packet();
0033 
0034   //! av_packet_unref() wrapper.
0035   Standard_EXPORT void Unref();
0036 
0037   //! Return packet.
0038   const AVPacket* Packet() const { return myPacket; }
0039 
0040   //! Return packet.
0041   AVPacket* ChangePacket() { return myPacket; }
0042 
0043   //! Return data.
0044   Standard_EXPORT const uint8_t* Data() const;
0045 
0046   //! Return data.
0047   Standard_EXPORT uint8_t* ChangeData();
0048 
0049   //! Return data size.
0050   Standard_EXPORT int Size() const;
0051 
0052   //! Return presentation timestamp (PTS).
0053   Standard_EXPORT int64_t Pts() const;
0054 
0055   //! Return decoding timestamp (DTS).
0056   Standard_EXPORT int64_t Dts() const;
0057 
0058   //! Return Duration.
0059   Standard_EXPORT int64_t Duration() const;
0060 
0061   //! Return Duration in seconds.
0062   double DurationSeconds() const { return myDurationSec; }
0063 
0064   //! Set Duration in seconds.
0065   void SetDurationSeconds(double theDurationSec) { myDurationSec = theDurationSec; }
0066 
0067   //! Return stream index.
0068   Standard_EXPORT int StreamIndex() const;
0069 
0070   //! Return TRUE for a key frame.
0071   Standard_EXPORT bool IsKeyFrame() const;
0072 
0073   //! Mark as key frame.
0074   Standard_EXPORT void SetKeyFrame();
0075 
0076 protected:
0077   AVPacket* myPacket;      //!< packet
0078   double    myDurationSec; //!< packet duration in seconds
0079 };
0080 
0081 #endif // _Media_Packet_HeaderFile