Main Page
Namespaces
Classes
Files
File List
File Members
include
h264_encoder_core
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
30
#include <
aws_common/sdk_utils/parameter_reader.h
>
31
32
namespace
Aws
{
33
namespace
Utils {
34
namespace
Encoding {
35
36
struct
H264EncoderResult
37
{
38
H264EncoderResult
() {
Reset
(); }
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
58
class
H264Encoder
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
Aws
Aws::Utils::Encoding::H264Encoder::impl_
std::unique_ptr< H264EncoderImpl > impl_
Definition:
h264_encoder.h:91
Aws::Utils::Encoding::H264EncoderResult::key_frame
bool key_frame
Definition:
h264_encoder.h:53
Aws::Utils::Encoding::H264EncoderImpl
Definition:
h264_encoder.cpp:57
Aws::Utils::Encoding::H264EncoderResult::frame_duration
uint64_t frame_duration
Definition:
h264_encoder.h:52
Aws::Utils::Encoding::H264Encoder
Definition:
h264_encoder.h:58
Aws::AwsError
AwsError
Aws::Utils::Encoding::H264EncoderResult::frame_pts
uint64_t frame_pts
Definition:
h264_encoder.h:50
Aws::Client::ParameterReaderInterface
Aws::Utils::Encoding::H264EncoderResult::H264EncoderResult
H264EncoderResult()
Definition:
h264_encoder.h:38
Aws::Utils::Encoding::H264EncoderResult::frame_dts
uint64_t frame_dts
Definition:
h264_encoder.h:51
Aws::Utils::Encoding::H264EncoderResult::Reset
void Reset()
Definition:
h264_encoder.h:40
parameter_reader.h
Aws::Utils::Encoding::H264EncoderResult::frame_data
std::vector< uint8_t > frame_data
Definition:
h264_encoder.h:49
Aws::Utils::Encoding::H264EncoderResult
Definition:
h264_encoder.h:36
h264_encoder_core
Author(s): AWS RoboMaker
autogenerated on Fri Mar 5 2021 03:31:35