1 // Copyright 2022 Samsung Electronics Inc. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_TIZEN_VIDEO_ENCODER_FACADE_UTILS_H_
6 #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_TIZEN_VIDEO_ENCODER_FACADE_UTILS_H_
12 #include <media_packet.h>
14 #include "third_party/blink/renderer/platform/peerconnection/tizen_video_encoder_utils.h"
19 // Enum representing currently used encoding mode of platform encoder.
20 // Once set, it cannot be changed.
21 enum class EncodingMode {
23 kEncodingFromSubscaler,
27 int NV12DataSize(int height, int stride_y, int stride_uv);
29 std::ostream& operator<<(std::ostream& os, encoder_input_type_e status);
30 std::ostream& operator<<(std::ostream& os, encoder_state_e state);
31 std::ostream& operator<<(std::ostream& os, encoder_buffer_status_e status);
32 std::ostream& operator<<(std::ostream& os, encoder_error_e err);
33 std::ostream& operator<<(std::ostream& os, media_format_error_e err);
34 std::ostream& operator<<(std::ostream& os, media_packet_error_e err);
35 std::ostream& operator<<(std::ostream& os, const EncodingMode& encoding_mode);
37 struct EncoderDeleter {
38 void operator()(encoder_h encoder);
41 struct MediaFormatDeleter {
42 void operator()(media_format_h media_format);
45 struct MediaPacketDeleter {
46 void operator()(media_packet_h packet);
49 // unique_ptr with custom deleter used for preventing leak of `media_packet_h`
51 using MediaPacketType =
52 std::unique_ptr<std::remove_pointer<media_packet_h>::type,
55 // unique_ptr with custom deleter used for preventing leak of `media_format_h`
57 using MediaFormatType =
58 std::unique_ptr<std::remove_pointer<media_format_h>::type,
64 #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_TIZEN_VIDEO_ENCODER_FACADE_UTILS_H_