Shaka Player Embedded
ffmpeg_encoded_frame.h
Go to the documentation of this file.
1 // Copyright 2017 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_ENCODED_FRAME_H_
16 #define SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_ENCODED_FRAME_H_
17 
18 extern "C" {
19 #include <libavformat/avformat.h>
20 }
21 
22 #include <memory>
23 
24 #include "shaka/media/frames.h"
25 
26 namespace shaka {
27 namespace media {
28 namespace ffmpeg {
29 
31 class FFmpegEncodedFrame final : public EncodedFrame {
32  public:
33  ~FFmpegEncodedFrame() override;
34 
35  static FFmpegEncodedFrame* MakeFrame(AVPacket* pkt,
36  std::shared_ptr<const StreamInfo> info,
37  double timestamp_offset);
38 
39  size_t EstimateSize() const override;
40 
41  private:
42  FFmpegEncodedFrame(AVPacket* pkt, double pts, double dts, double duration,
43  bool is_key_frame, std::shared_ptr<const StreamInfo> info,
44  std::shared_ptr<eme::FrameEncryptionInfo> encryption_info,
45  double timestamp_offset);
46 
47  AVPacket packet_;
48 };
49 
50 } // namespace ffmpeg
51 } // namespace media
52 } // namespace shaka
53 
54 #endif // SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_ENCODED_FRAME_H_
const bool is_key_frame
Definition: frames.h:211
const std::shared_ptr< eme::FrameEncryptionInfo > encryption_info
Definition: frames.h:259
static FFmpegEncodedFrame * MakeFrame(AVPacket *pkt, std::shared_ptr< const StreamInfo > info, double timestamp_offset)
const double timestamp_offset
Definition: frames.h:253
const double duration
Definition: frames.h:208
const double dts
Definition: frames.h:205
const double pts
Definition: frames.h:202