Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: webrtc/video_decoder.h

Issue 1406903002: Expose codec implementation names in stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 10
11 #ifndef WEBRTC_VIDEO_DECODER_H_ 11 #ifndef WEBRTC_VIDEO_DECODER_H_
12 #define WEBRTC_VIDEO_DECODER_H_ 12 #define WEBRTC_VIDEO_DECODER_H_
13 13
14 #include <string>
14 #include <vector> 15 #include <vector>
15 16
16 #include "webrtc/common_types.h" 17 #include "webrtc/common_types.h"
17 #include "webrtc/typedefs.h" 18 #include "webrtc/typedefs.h"
18 #include "webrtc/video_frame.h" 19 #include "webrtc/video_frame.h"
19 20
20 namespace webrtc { 21 namespace webrtc {
21 22
22 class RTPFragmentationHeader; 23 class RTPFragmentationHeader;
23 // TODO(pbos): Expose these through a public (root) header or change these APIs. 24 // TODO(pbos): Expose these through a public (root) header or change these APIs.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 bool missing_frames, 57 bool missing_frames,
57 const RTPFragmentationHeader* fragmentation, 58 const RTPFragmentationHeader* fragmentation,
58 const CodecSpecificInfo* codec_specific_info = NULL, 59 const CodecSpecificInfo* codec_specific_info = NULL,
59 int64_t render_time_ms = -1) = 0; 60 int64_t render_time_ms = -1) = 0;
60 61
61 virtual int32_t RegisterDecodeCompleteCallback( 62 virtual int32_t RegisterDecodeCompleteCallback(
62 DecodedImageCallback* callback) = 0; 63 DecodedImageCallback* callback) = 0;
63 64
64 virtual int32_t Release() = 0; 65 virtual int32_t Release() = 0;
65 virtual int32_t Reset() = 0; 66 virtual int32_t Reset() = 0;
67 virtual const char* ImplementationName() const { return "unknown"; }
66 }; 68 };
67 69
68 // Class used to wrap external VideoDecoders to provide a fallback option on 70 // Class used to wrap external VideoDecoders to provide a fallback option on
69 // software decoding when a hardware decoder fails to decode a stream due to 71 // software decoding when a hardware decoder fails to decode a stream due to
70 // hardware restrictions, such as max resolution. 72 // hardware restrictions, such as max resolution.
71 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder { 73 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder {
72 public: 74 public:
73 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type, 75 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type,
74 VideoDecoder* decoder); 76 VideoDecoder* decoder);
75 77
76 int32_t InitDecode(const VideoCodec* codec_settings, 78 int32_t InitDecode(const VideoCodec* codec_settings,
77 int32_t number_of_cores) override; 79 int32_t number_of_cores) override;
78 80
79 int32_t Decode(const EncodedImage& input_image, 81 int32_t Decode(const EncodedImage& input_image,
80 bool missing_frames, 82 bool missing_frames,
81 const RTPFragmentationHeader* fragmentation, 83 const RTPFragmentationHeader* fragmentation,
82 const CodecSpecificInfo* codec_specific_info, 84 const CodecSpecificInfo* codec_specific_info,
83 int64_t render_time_ms) override; 85 int64_t render_time_ms) override;
84 86
85 int32_t RegisterDecodeCompleteCallback( 87 int32_t RegisterDecodeCompleteCallback(
86 DecodedImageCallback* callback) override; 88 DecodedImageCallback* callback) override;
87 89
88 int32_t Release() override; 90 int32_t Release() override;
89 int32_t Reset() override; 91 int32_t Reset() override;
90 92
93 const char* ImplementationName() const override;
94
91 private: 95 private:
92 bool InitFallbackDecoder(); 96 bool InitFallbackDecoder();
93 97
94 const DecoderType decoder_type_; 98 const DecoderType decoder_type_;
95 VideoDecoder* const decoder_; 99 VideoDecoder* const decoder_;
96 100
97 VideoCodec codec_settings_; 101 VideoCodec codec_settings_;
98 int32_t number_of_cores_; 102 int32_t number_of_cores_;
103 std::string fallback_implementation_name_;
99 rtc::scoped_ptr<VideoDecoder> fallback_decoder_; 104 rtc::scoped_ptr<VideoDecoder> fallback_decoder_;
100 DecodedImageCallback* callback_; 105 DecodedImageCallback* callback_;
101 }; 106 };
102 107
103 } // namespace webrtc 108 } // namespace webrtc
104 109
105 #endif // WEBRTC_VIDEO_DECODER_H_ 110 #endif // WEBRTC_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698