h264_encoder.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 #pragma once
20 
21 #include <stdint.h>
22 
23 #include <memory>
24 #include <vector>
25 
26 extern "C" {
27 #include <libavutil/pixfmt.h>
28 }
29 
31 
32 namespace Aws {
33 namespace Utils {
34 namespace Encoding {
35 
37 {
39 
40  void Reset()
41  {
42  frame_data.clear();
43  frame_pts = 0;
44  frame_dts = 0;
45  frame_duration = 0;
46  key_frame = false;
47  }
48 
49  std::vector<uint8_t> frame_data;
50  uint64_t frame_pts;
51  uint64_t frame_dts;
52  uint64_t frame_duration;
53  bool key_frame;
54 };
55 
56 class H264EncoderImpl;
57 
59 {
60 public:
61  H264Encoder();
62 
63  ~H264Encoder();
64 
74  AwsError Initialize(const int src_width, const int src_height, const AVPixelFormat src_encoding,
75  const Aws::Client::ParameterReaderInterface & dst_params);
76 
82  AwsError Encode(const uint8_t * img_data, H264EncoderResult & res) const;
83 
88  std::vector<uint8_t> GetExtraData() const;
89 
90 private:
91  std::unique_ptr<H264EncoderImpl> impl_;
92 };
93 
94 } // namespace Encoding
95 } // namespace Utils
96 } // namespace Aws
std::unique_ptr< H264EncoderImpl > impl_
Definition: h264_encoder.h:91


h264_encoder_core
Author(s): AWS RoboMaker
autogenerated on Fri Mar 5 2021 03:31:35