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

Side by Side Diff: services/video_capture/public/interfaces/video_capture_format_traits.cc

Issue 2398813002: Cleanup of video capture into GpuMemoryBuffer (Closed)
Patch Set: Rebase Created 4 years, 2 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
« no previous file with comments | « media/capture/video/video_capture_device_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/video_capture/public/interfaces/video_capture_format_traits.h " 5 #include "services/video_capture/public/interfaces/video_capture_format_traits.h "
6 6
7 #include "ui/gfx/geometry/mojo/geometry.mojom.h" 7 #include "ui/gfx/geometry/mojo/geometry.mojom.h"
8 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" 8 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 15 matching lines...) Expand all
26 static_cast<media::VideoPixelFormat>(data.pixel_format()); 26 static_cast<media::VideoPixelFormat>(data.pixel_format());
27 if (!data.ReadPixelStorage(&out->pixel_storage)) 27 if (!data.ReadPixelStorage(&out->pixel_storage))
28 return false; 28 return false;
29 return true; 29 return true;
30 } 30 }
31 31
32 // static 32 // static
33 video_capture::mojom::VideoPixelStorage 33 video_capture::mojom::VideoPixelStorage
34 EnumTraits<video_capture::mojom::VideoPixelStorage, media::VideoPixelStorage>:: 34 EnumTraits<video_capture::mojom::VideoPixelStorage, media::VideoPixelStorage>::
35 ToMojom(media::VideoPixelStorage video_pixel_storage) { 35 ToMojom(media::VideoPixelStorage video_pixel_storage) {
36 switch (video_pixel_storage) { 36 DCHECK_EQ(media::PIXEL_STORAGE_CPU, video_pixel_storage);
37 case media::PIXEL_STORAGE_CPU:
38 return video_capture::mojom::VideoPixelStorage::CPU;
39 case media::PIXEL_STORAGE_GPUMEMORYBUFFER:
40 return video_capture::mojom::VideoPixelStorage::GPUMEMORYBUFFER;
41 }
42 NOTREACHED();
43 return video_capture::mojom::VideoPixelStorage::CPU; 37 return video_capture::mojom::VideoPixelStorage::CPU;
44 } 38 }
45 39
46 // static 40 // static
47 bool EnumTraits<video_capture::mojom::VideoPixelStorage, 41 bool EnumTraits<video_capture::mojom::VideoPixelStorage,
48 media::VideoPixelStorage>:: 42 media::VideoPixelStorage>::
49 FromMojom(video_capture::mojom::VideoPixelStorage input, 43 FromMojom(video_capture::mojom::VideoPixelStorage input,
50 media::VideoPixelStorage* out) { 44 media::VideoPixelStorage* out) {
51 switch (input) { 45 DCHECK_EQ(video_capture::mojom::VideoPixelStorage::CPU, input);
52 case video_capture::mojom::VideoPixelStorage::CPU: 46 *out = media::PIXEL_STORAGE_CPU;
53 *out = media::PIXEL_STORAGE_CPU; 47 return true;
54 return true;
55 case video_capture::mojom::VideoPixelStorage::GPUMEMORYBUFFER:
56 *out = media::PIXEL_STORAGE_GPUMEMORYBUFFER;
57 return true;
58 }
59 NOTREACHED();
60 return false;
61 } 48 }
62 49
63 } // namespace mojo 50 } // namespace mojo
OLDNEW
« no previous file with comments | « media/capture/video/video_capture_device_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698