Shaka Player Embedded
ffmpeg_decoded_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_DECODED_FRAME_H_
16 #define SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_DECODED_FRAME_H_
17 
18 extern "C" {
19 #include <libavcodec/avcodec.h>
20 #include <libavformat/avformat.h>
21 }
22 
23 #include <memory>
24 #include <vector>
25 
26 #include "shaka/media/frames.h"
28 #include "src/util/macros.h"
29 
30 namespace shaka {
31 namespace media {
32 namespace ffmpeg {
33 
35 class FFmpegDecodedFrame final : public DecodedFrame {
36  public:
37  ~FFmpegDecodedFrame() override;
38 
40  std::shared_ptr<const StreamInfo> stream, AVFrame* frame, double time,
41  double duration);
42 
43  size_t EstimateSize() const override;
44 
45  AVFrame* raw_frame() const {
46  return frame_;
47  }
48 
49  private:
50  FFmpegDecodedFrame(AVFrame* frame, double pts, double dts, double duration,
51  std::shared_ptr<const StreamInfo> stream,
53  const std::vector<const uint8_t*>& data,
54  const std::vector<size_t>& linesize);
55 
56  AVFrame* frame_;
57 };
58 
59 } // namespace ffmpeg
60 } // namespace media
61 } // namespace shaka
62 
63 #endif // SHAKA_EMBEDDED_MEDIA_FFMPEG_FFMPEG_DECODED_FRAME_H_
static FFmpegDecodedFrame * CreateFrame(std::shared_ptr< const StreamInfo > stream, AVFrame *frame, double time, double duration)
const std::vector< size_t > linesize
Definition: frames.h:322
std::shared_ptr< shaka::media::DecodedFrame > frame
const std::vector< const uint8_t * > data
Definition: frames.h:312
const variant< PixelFormat, SampleFormat > format
Definition: frames.h:325
const double duration
Definition: frames.h:208
const double dts
Definition: frames.h:205
const double pts
Definition: frames.h:202