OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 * | 9 * |
10 * WEBRTC VP8 wrapper interface | 10 * WEBRTC VP8 wrapper interface |
(...skipping 68 matching lines...) Loading... |
79 // Call encoder initialize function and set control settings. | 79 // Call encoder initialize function and set control settings. |
80 int InitAndSetControlSettings(); | 80 int InitAndSetControlSettings(); |
81 | 81 |
82 void PopulateCodecSpecific(CodecSpecificInfo* codec_specific, | 82 void PopulateCodecSpecific(CodecSpecificInfo* codec_specific, |
83 const TemporalLayers::FrameConfig& tl_config, | 83 const TemporalLayers::FrameConfig& tl_config, |
84 const vpx_codec_cx_pkt& pkt, | 84 const vpx_codec_cx_pkt& pkt, |
85 int stream_idx, | 85 int stream_idx, |
86 uint32_t timestamp); | 86 uint32_t timestamp); |
87 | 87 |
88 int GetEncodedPartitions(const TemporalLayers::FrameConfig tl_configs[], | 88 int GetEncodedPartitions(const TemporalLayers::FrameConfig tl_configs[], |
89 const VideoFrame& input_image); | 89 const VideoFrame& input_image, |
| 90 int64_t encode_start_ms); |
90 | 91 |
91 // Set the stream state for stream |stream_idx|. | 92 // Set the stream state for stream |stream_idx|. |
92 void SetStreamState(bool send_stream, int stream_idx); | 93 void SetStreamState(bool send_stream, int stream_idx); |
93 | 94 |
94 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size); | 95 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size); |
95 | 96 |
96 const bool use_gf_boost_; | 97 const bool use_gf_boost_; |
97 | 98 |
98 EncodedImageCallback* encoded_complete_callback_; | 99 EncodedImageCallback* encoded_complete_callback_; |
99 VideoCodec codec_; | 100 VideoCodec codec_; |
100 bool inited_; | 101 bool inited_; |
101 int64_t timestamp_; | 102 int64_t timestamp_; |
102 int qp_max_; | 103 int qp_max_; |
103 int cpu_speed_default_; | 104 int cpu_speed_default_; |
104 int number_of_cores_; | 105 int number_of_cores_; |
105 uint32_t rc_max_intra_target_; | 106 uint32_t rc_max_intra_target_; |
106 std::vector<std::unique_ptr<TemporalLayers>> temporal_layers_; | 107 std::vector<std::unique_ptr<TemporalLayers>> temporal_layers_; |
107 std::vector<uint16_t> picture_id_; | 108 std::vector<uint16_t> picture_id_; |
108 std::vector<uint8_t> tl0_pic_idx_; | 109 std::vector<uint8_t> tl0_pic_idx_; |
109 std::vector<bool> key_frame_request_; | 110 std::vector<bool> key_frame_request_; |
110 std::vector<bool> send_stream_; | 111 std::vector<bool> send_stream_; |
111 std::vector<int> cpu_speed_; | 112 std::vector<int> cpu_speed_; |
112 std::vector<vpx_image_t> raw_images_; | 113 std::vector<vpx_image_t> raw_images_; |
113 std::vector<EncodedImage> encoded_images_; | 114 std::vector<EncodedImage> encoded_images_; |
114 std::vector<vpx_codec_ctx_t> encoders_; | 115 std::vector<vpx_codec_ctx_t> encoders_; |
115 std::vector<vpx_codec_enc_cfg_t> configurations_; | 116 std::vector<vpx_codec_enc_cfg_t> configurations_; |
116 std::vector<vpx_rational_t> downsampling_factors_; | 117 std::vector<vpx_rational_t> downsampling_factors_; |
| 118 int64_t last_timing_frame_time_ms_; |
117 }; | 119 }; |
118 | 120 |
119 class VP8DecoderImpl : public VP8Decoder { | 121 class VP8DecoderImpl : public VP8Decoder { |
120 public: | 122 public: |
121 VP8DecoderImpl(); | 123 VP8DecoderImpl(); |
122 | 124 |
123 virtual ~VP8DecoderImpl(); | 125 virtual ~VP8DecoderImpl(); |
124 | 126 |
125 int InitDecode(const VideoCodec* inst, int number_of_cores) override; | 127 int InitDecode(const VideoCodec* inst, int number_of_cores) override; |
126 | 128 |
(...skipping 21 matching lines...) Loading... |
148 bool inited_; | 150 bool inited_; |
149 vpx_codec_ctx_t* decoder_; | 151 vpx_codec_ctx_t* decoder_; |
150 int propagation_cnt_; | 152 int propagation_cnt_; |
151 int last_frame_width_; | 153 int last_frame_width_; |
152 int last_frame_height_; | 154 int last_frame_height_; |
153 bool key_frame_required_; | 155 bool key_frame_required_; |
154 }; | 156 }; |
155 } // namespace webrtc | 157 } // namespace webrtc |
156 | 158 |
157 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_VP8_IMPL_H_ | 159 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_VP8_IMPL_H_ |
OLD | NEW |