Shaka Packager SDK
Loading...
Searching...
No Matches
video_slice_header_parser.h
1// Copyright 2016 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#ifndef PACKAGER_MEDIA_CODECS_VIDEO_SLICE_HEADER_PARSER_H_
8#define PACKAGER_MEDIA_CODECS_VIDEO_SLICE_HEADER_PARSER_H_
9
10#include <vector>
11
12#include <packager/macros/classes.h>
13#include <packager/media/codecs/h264_parser.h>
14#include <packager/media/codecs/h265_parser.h>
15
16namespace shaka {
17namespace media {
18
20 public:
22 virtual ~VideoSliceHeaderParser() {}
23
26 virtual bool Initialize(
27 const std::vector<uint8_t>& decoder_configuration) = 0;
28
35 virtual bool ProcessNalu(const Nalu& nalu) = 0;
36
38 virtual int64_t GetHeaderSize(const Nalu& nalu) = 0;
39
40 private:
41 DISALLOW_COPY_AND_ASSIGN(VideoSliceHeaderParser);
42};
43
45 public:
48
51 bool Initialize(const std::vector<uint8_t>& decoder_configuration) override;
52 bool ProcessNalu(const Nalu& nalu) override;
53 int64_t GetHeaderSize(const Nalu& nalu) override;
55
56 private:
57 H264Parser parser_;
58
59 DISALLOW_COPY_AND_ASSIGN(H264VideoSliceHeaderParser);
60};
61
63 public:
66
69 bool Initialize(const std::vector<uint8_t>& decoder_configuration) override;
70 bool ProcessNalu(const Nalu& nalu) override;
71 int64_t GetHeaderSize(const Nalu& nalu) override;
73
74 private:
75 H265Parser parser_;
76
77 DISALLOW_COPY_AND_ASSIGN(H265VideoSliceHeaderParser);
78};
79
80} // namespace media
81} // namespace shaka
82
83#endif // PACKAGER_MEDIA_CODECS_VIDEO_SLICE_HEADER_PARSER_H_
bool Initialize(const std::vector< uint8_t > &decoder_configuration) override
int64_t GetHeaderSize(const Nalu &nalu) override
Gets the header size of the given NALU. Returns < 0 on error.
int64_t GetHeaderSize(const Nalu &nalu) override
Gets the header size of the given NALU. Returns < 0 on error.
bool Initialize(const std::vector< uint8_t > &decoder_configuration) override
virtual int64_t GetHeaderSize(const Nalu &nalu)=0
Gets the header size of the given NALU. Returns < 0 on error.
virtual bool Initialize(const std::vector< uint8_t > &decoder_configuration)=0
virtual bool ProcessNalu(const Nalu &nalu)=0
All the methods that are virtual are virtual for mocking.