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

Side by Side Diff: webrtc/modules/video_capture/windows/device_info_ds.cc

Issue 2765243002: Delete RawVideoType enum, use the VideoType enum instead. (Closed)
Patch Set: Define constant webrtc::kI420, for backwards compatibility. Created 3 years, 7 months 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if (avgTimePerFrame > 0) 582 if (avgTimePerFrame > 0)
583 capability.maxFPS = static_cast<int> (10000000 583 capability.maxFPS = static_cast<int> (10000000
584 / avgTimePerFrame); 584 / avgTimePerFrame);
585 else 585 else
586 capability.maxFPS = 0; 586 capability.maxFPS = 0;
587 } 587 }
588 588
589 // can't switch MEDIATYPE :~( 589 // can't switch MEDIATYPE :~(
590 if (pmt->subtype == MEDIASUBTYPE_I420) 590 if (pmt->subtype == MEDIASUBTYPE_I420)
591 { 591 {
592 capability.rawType = kVideoI420; 592 capability.videoType = VideoType::kI420;
593 } 593 }
594 else if (pmt->subtype == MEDIASUBTYPE_IYUV) 594 else if (pmt->subtype == MEDIASUBTYPE_IYUV)
595 { 595 {
596 capability.rawType = kVideoIYUV; 596 capability.videoType = VideoType::kIYUV;
597 } 597 }
598 else if (pmt->subtype == MEDIASUBTYPE_RGB24) 598 else if (pmt->subtype == MEDIASUBTYPE_RGB24)
599 { 599 {
600 capability.rawType = kVideoRGB24; 600 capability.videoType = VideoType::kRGB24;
601 } 601 }
602 else if (pmt->subtype == MEDIASUBTYPE_YUY2) 602 else if (pmt->subtype == MEDIASUBTYPE_YUY2)
603 { 603 {
604 capability.rawType = kVideoYUY2; 604 capability.videoType = VideoType::kYUY2;
605 } 605 }
606 else if (pmt->subtype == MEDIASUBTYPE_RGB565) 606 else if (pmt->subtype == MEDIASUBTYPE_RGB565)
607 { 607 {
608 capability.rawType = kVideoRGB565; 608 capability.videoType = VideoType::kRGB565;
609 } 609 }
610 else if (pmt->subtype == MEDIASUBTYPE_MJPG) 610 else if (pmt->subtype == MEDIASUBTYPE_MJPG)
611 { 611 {
612 capability.rawType = kVideoMJPEG; 612 capability.videoType = VideoType::kMJPEG;
613 } 613 }
614 else if (pmt->subtype == MEDIASUBTYPE_dvsl 614 else if (pmt->subtype == MEDIASUBTYPE_dvsl
615 || pmt->subtype == MEDIASUBTYPE_dvsd 615 || pmt->subtype == MEDIASUBTYPE_dvsd
616 || pmt->subtype == MEDIASUBTYPE_dvhd) // If this is an exter nal DV camera 616 || pmt->subtype == MEDIASUBTYPE_dvhd) // If this is an exter nal DV camera
617 { 617 {
618 capability.rawType = kVideoYUY2;// MS DV filter seems to create this type 618 capability.videoType =
619 VideoType::kYUY2; // MS DV filter seems to create this type
619 } 620 }
620 else if (pmt->subtype == MEDIASUBTYPE_UYVY) // Seen used by Declink capture cards 621 else if (pmt->subtype == MEDIASUBTYPE_UYVY) // Seen used by Declink capture cards
621 { 622 {
622 capability.rawType = kVideoUYVY; 623 capability.videoType = VideoType::kUYVY;
623 } 624 }
624 else if (pmt->subtype == MEDIASUBTYPE_HDYC) // Seen used by Declink capture cards. Uses BT. 709 color. Not entiry correct to use UYVY. http://en.wik ipedia.org/wiki/YCbCr 625 else if (pmt->subtype == MEDIASUBTYPE_HDYC) // Seen used by Declink capture cards. Uses BT. 709 color. Not entiry correct to use UYVY. http://en.wik ipedia.org/wiki/YCbCr
625 { 626 {
626 WEBRTC_TRACE(webrtc::kTraceWarning, 627 WEBRTC_TRACE(webrtc::kTraceWarning,
627 webrtc::kTraceVideoCapture, 0, 628 webrtc::kTraceVideoCapture, 0,
628 "Device support HDYC."); 629 "Device support HDYC.");
629 capability.rawType = kVideoUYVY; 630 capability.videoType = VideoType::kUYVY;
630 } 631 }
631 else 632 else
632 { 633 {
633 WCHAR strGuid[39]; 634 WCHAR strGuid[39];
634 StringFromGUID2(pmt->subtype, strGuid, 39); 635 StringFromGUID2(pmt->subtype, strGuid, 39);
635 WEBRTC_TRACE( webrtc::kTraceWarning, 636 WEBRTC_TRACE( webrtc::kTraceWarning,
636 webrtc::kTraceVideoCapture, 0, 637 webrtc::kTraceVideoCapture, 0,
637 "Device support unknown media type %ls, width %d, h eight %d", 638 "Device support unknown media type %ls, width %d, h eight %d",
638 strGuid); 639 strGuid);
639 continue; 640 continue;
640 } 641 }
641 642
642 _captureCapabilities.push_back(capability); 643 _captureCapabilities.push_back(capability);
643 _captureCapabilitiesWindows.push_back(capability); 644 _captureCapabilitiesWindows.push_back(capability);
644 WEBRTC_TRACE( webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0, 645 WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
645 "Camera capability, width:%d height:%d type:%d fps:%d", 646 "Camera capability, width:%d height:%d type:%d fps:%d",
646 capability.width, capability.height, 647 capability.width, capability.height,
647 capability.rawType, capability.maxFPS); 648 static_cast<int>(capability.videoType),
649 capability.maxFPS);
648 } 650 }
649 DeleteMediaType(pmt); 651 DeleteMediaType(pmt);
650 pmt = NULL; 652 pmt = NULL;
651 } 653 }
652 RELEASE_AND_CLEAR(streamConfig); 654 RELEASE_AND_CLEAR(streamConfig);
653 RELEASE_AND_CLEAR(videoControlConfig); 655 RELEASE_AND_CLEAR(videoControlConfig);
654 RELEASE_AND_CLEAR(outputCapturePin); 656 RELEASE_AND_CLEAR(outputCapturePin);
655 RELEASE_AND_CLEAR(captureDevice); // Release the capture device 657 RELEASE_AND_CLEAR(captureDevice); // Release the capture device
656 658
657 // Store the new used device name 659 // Store the new used device name
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 // Release memory. 768 // Release memory.
767 if (uuid.pElems) 769 if (uuid.pElems)
768 { 770 {
769 CoTaskMemFree(uuid.pElems); 771 CoTaskMemFree(uuid.pElems);
770 } 772 }
771 filter->Release(); 773 filter->Release();
772 return 0; 774 return 0;
773 } 775 }
774 } // namespace videocapturemodule 776 } // namespace videocapturemodule
775 } // namespace webrtc 777 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_capture/video_capture_impl.cc ('k') | webrtc/modules/video_capture/windows/sink_filter_ds.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698