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

Side by Side Diff: content/browser/media/media_internals.cc

Issue 2169013002: Change class VideoCaptureDevice::Name to struct VideoCaptureDeviceDescriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed emircan's comments Created 4 years, 4 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/media_internals.h" 5 #include "content/browser/media/media_internals.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 base::ListValue* format_list = new base::ListValue(); 608 base::ListValue* format_list = new base::ListValue();
609 // TODO(nisse): Representing format information as a string, to be 609 // TODO(nisse): Representing format information as a string, to be
610 // parsed by the javascript handler, is brittle. Consider passing 610 // parsed by the javascript handler, is brittle. Consider passing
611 // a list of mappings instead. 611 // a list of mappings instead.
612 612
613 for (const auto& format : video_capture_device_info.supported_formats) 613 for (const auto& format : video_capture_device_info.supported_formats)
614 format_list->AppendString(media::VideoCaptureFormat::ToString(format)); 614 format_list->AppendString(media::VideoCaptureFormat::ToString(format));
615 615
616 std::unique_ptr<base::DictionaryValue> device_dict( 616 std::unique_ptr<base::DictionaryValue> device_dict(
617 new base::DictionaryValue()); 617 new base::DictionaryValue());
618 device_dict->SetString("id", video_capture_device_info.name.id()); 618 device_dict->SetString("id",
619 device_dict->SetString( 619 video_capture_device_info.descriptor.device_id);
620 "name", video_capture_device_info.name.GetNameAndModel()); 620 device_dict->SetString("name", video_capture_device_info.GetNameAndModel());
621 device_dict->Set("formats", format_list); 621 device_dict->Set("formats", format_list);
622 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ 622 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
623 defined(OS_ANDROID) 623 defined(OS_ANDROID)
624 device_dict->SetString( 624 device_dict->SetString(
625 "captureApi", video_capture_device_info.name.GetCaptureApiTypeString()); 625 "captureApi",
626 video_capture_device_info.descriptor.GetCaptureApiTypeString());
626 #endif 627 #endif
627 video_capture_capabilities_cached_data_.Append(std::move(device_dict)); 628 video_capture_capabilities_cached_data_.Append(std::move(device_dict));
628 } 629 }
629 630
630 SendVideoCaptureDeviceCapabilities(); 631 SendVideoCaptureDeviceCapabilities();
631 } 632 }
632 633
633 std::unique_ptr<media::AudioLog> MediaInternals::CreateAudioLog( 634 std::unique_ptr<media::AudioLog> MediaInternals::CreateAudioLog(
634 AudioComponent component) { 635 AudioComponent component) {
635 base::AutoLock auto_lock(lock_); 636 base::AutoLock auto_lock(lock_);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 audio_streams_cached_data_.GetDictionary(cache_key, &existing_dict)); 702 audio_streams_cached_data_.GetDictionary(cache_key, &existing_dict));
702 existing_dict->MergeDictionary(value); 703 existing_dict->MergeDictionary(value);
703 } 704 }
704 } 705 }
705 706
706 if (CanUpdate()) 707 if (CanUpdate())
707 SendUpdate(SerializeUpdate(function, value)); 708 SendUpdate(SerializeUpdate(function, value));
708 } 709 }
709 710
710 } // namespace content 711 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/media_internals_unittest.cc » ('j') | content/browser/media/media_internals_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698