Shaka Player Embedded
apple_decoded_frame.h
Go to the documentation of this file.
1 // Copyright 2019 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_APPLE_DECODED_FRAME_H_
16 #define SHAKA_EMBEDDED_MEDIA_APPLE_DECODED_FRAME_H_
17 
18 #include <CoreVideo/CoreVideo.h>
19 
20 #include <memory>
21 #include <vector>
22 
23 #include "shaka/media/frames.h"
24 #include "src/util/cfref.h"
25 
26 namespace shaka {
27 namespace media {
28 namespace apple {
29 
31 class AppleDecodedFrame final : public DecodedFrame {
32  public:
33  // An audio frame.
34  AppleDecodedFrame(std::shared_ptr<const StreamInfo> stream, double time,
35  double duration, SampleFormat format, uint32_t sample_count,
36  std::vector<uint8_t> buffer);
37  // A video frame.
38  AppleDecodedFrame(std::shared_ptr<const StreamInfo> stream, double time,
39  double duration, CVImageBufferRef img);
40  ~AppleDecodedFrame() override;
41 
42  private:
43  util::CFRef<CVImageBufferRef> img_;
44  std::vector<uint8_t> data_;
45 };
46 
47 } // namespace apple
48 } // namespace media
49 } // namespace shaka
50 
51 #endif // SHAKA_EMBEDDED_MEDIA_APPLE_DECODED_FRAME_H_
const size_t sample_count
Definition: frames.h:296
AppleDecodedFrame(std::shared_ptr< const StreamInfo > stream, double time, double duration, SampleFormat format, uint32_t sample_count, std::vector< uint8_t > buffer)
const variant< PixelFormat, SampleFormat > format
Definition: frames.h:325
const double duration
Definition: frames.h:208