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

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.cc

Issue 2509273002: Unify VideoCodecType to/from string functionality (Closed)
Patch Set: Rebase and update unknown string in WebRtcVideoEncoderFactory Created 4 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) 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 10
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 case kExcludeOnlyFirstKeyFrame: 396 case kExcludeOnlyFirstKeyFrame:
397 return "ExcludeOnlyFirstKeyFrame"; 397 return "ExcludeOnlyFirstKeyFrame";
398 case kExcludeAllKeyFrames: 398 case kExcludeAllKeyFrames:
399 return "ExcludeAllKeyFrames"; 399 return "ExcludeAllKeyFrames";
400 default: 400 default:
401 RTC_NOTREACHED(); 401 RTC_NOTREACHED();
402 return "Unknown"; 402 return "Unknown";
403 } 403 }
404 } 404 }
405 405
406 const char* VideoCodecTypeToStr(webrtc::VideoCodecType e) {
407 switch (e) {
408 case kVideoCodecVP8:
409 return "VP8";
410 case kVideoCodecI420:
411 return "I420";
412 case kVideoCodecRED:
413 return "RED";
414 case kVideoCodecULPFEC:
415 return "ULPFEC";
416 case kVideoCodecUnknown:
417 return "Unknown";
418 default:
419 RTC_NOTREACHED();
420 return "Unknown";
421 }
422 }
423
424 // Callbacks 406 // Callbacks
425 EncodedImageCallback::Result 407 EncodedImageCallback::Result
426 VideoProcessorImpl::VideoProcessorEncodeCompleteCallback::OnEncodedImage( 408 VideoProcessorImpl::VideoProcessorEncodeCompleteCallback::OnEncodedImage(
427 const EncodedImage& encoded_image, 409 const EncodedImage& encoded_image,
428 const webrtc::CodecSpecificInfo* codec_specific_info, 410 const webrtc::CodecSpecificInfo* codec_specific_info,
429 const webrtc::RTPFragmentationHeader* fragmentation) { 411 const webrtc::RTPFragmentationHeader* fragmentation) {
430 // Forward to parent class. 412 // Forward to parent class.
431 RTC_CHECK(codec_specific_info); 413 RTC_CHECK(codec_specific_info);
432 video_processor_->FrameEncoded(codec_specific_info->codecType, 414 video_processor_->FrameEncoded(codec_specific_info->codecType,
433 encoded_image, 415 encoded_image,
434 fragmentation); 416 fragmentation);
435 return Result(Result::OK, 0); 417 return Result(Result::OK, 0);
436 } 418 }
437 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded( 419 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded(
438 VideoFrame& image) { 420 VideoFrame& image) {
439 // Forward to parent class. 421 // Forward to parent class.
440 video_processor_->FrameDecoded(image); 422 video_processor_->FrameDecoded(image);
441 return 0; 423 return 0;
442 } 424 }
443 425
444 } // namespace test 426 } // namespace test
445 } // namespace webrtc 427 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698