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

Side by Side Diff: media/mojo/common/media_type_converters.cc

Issue 2408063009: media: Use native DecodeStatus in media mojo interfaces (Closed)
Patch Set: 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/mojo/clients/mojo_video_decoder.cc ('k') | media/mojo/interfaces/media_types.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/mojo/common/media_type_converters.h" 5 #include "media/mojo/common/media_type_converters.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 23 matching lines...) Expand all
34 static_cast<media::media_enum>( \ 34 static_cast<media::media_enum>( \
35 media::mojom::media_enum::mojo_prefix##value), \ 35 media::mojom::media_enum::mojo_prefix##value), \
36 "Mismatched enum: " #media_prefix #value " != " #media_enum \ 36 "Mismatched enum: " #media_prefix #value " != " #media_enum \
37 "::" #mojo_prefix #value) 37 "::" #mojo_prefix #value)
38 38
39 #define ASSERT_ENUM_EQ_RAW(media_enum, media_enum_value, mojo_enum_value) \ 39 #define ASSERT_ENUM_EQ_RAW(media_enum, media_enum_value, mojo_enum_value) \
40 static_assert(media::media_enum_value == static_cast<media::media_enum>( \ 40 static_assert(media::media_enum_value == static_cast<media::media_enum>( \
41 media::mojom::mojo_enum_value), \ 41 media::mojom::mojo_enum_value), \
42 "Mismatched enum: " #media_enum_value " != " #mojo_enum_value) 42 "Mismatched enum: " #media_enum_value " != " #mojo_enum_value)
43 43
44 #define ASSERT_ENUM_CLASS_EQ(media_enum, value) \ 44 #define ASSERT_ENUM_CLASS_EQ(media_enum, value) \
jrummell 2016/10/13 20:40:20 CodeSearch only shows the 3 removed lines as using
xhwang 2016/10/13 20:52:36 Good catch. Done.
45 static_assert( \ 45 static_assert( \
46 media::media_enum::value == \ 46 media::media_enum::value == \
47 static_cast<media::media_enum>(media::mojom::media_enum::value), \ 47 static_cast<media::media_enum>(media::mojom::media_enum::value), \
48 "Mismatched enum: " #media_enum #value) 48 "Mismatched enum: " #media_enum #value)
49 49
50 // DecodeStatus.
51 ASSERT_ENUM_CLASS_EQ(DecodeStatus, OK);
52 ASSERT_ENUM_CLASS_EQ(DecodeStatus, ABORTED);
53 ASSERT_ENUM_CLASS_EQ(DecodeStatus, DECODE_ERROR);
54
55 // AudioCodec. 50 // AudioCodec.
56 ASSERT_ENUM_EQ_RAW(AudioCodec, kUnknownAudioCodec, AudioCodec::UNKNOWN); 51 ASSERT_ENUM_EQ_RAW(AudioCodec, kUnknownAudioCodec, AudioCodec::UNKNOWN);
57 ASSERT_ENUM_EQ(AudioCodec, kCodec, , AAC); 52 ASSERT_ENUM_EQ(AudioCodec, kCodec, , AAC);
58 ASSERT_ENUM_EQ(AudioCodec, kCodec, , MP3); 53 ASSERT_ENUM_EQ(AudioCodec, kCodec, , MP3);
59 ASSERT_ENUM_EQ(AudioCodec, kCodec, , PCM); 54 ASSERT_ENUM_EQ(AudioCodec, kCodec, , PCM);
60 ASSERT_ENUM_EQ(AudioCodec, kCodec, , Vorbis); 55 ASSERT_ENUM_EQ(AudioCodec, kCodec, , Vorbis);
61 ASSERT_ENUM_EQ(AudioCodec, kCodec, , FLAC); 56 ASSERT_ENUM_EQ(AudioCodec, kCodec, , FLAC);
62 ASSERT_ENUM_EQ(AudioCodec, kCodec, , AMR_NB); 57 ASSERT_ENUM_EQ(AudioCodec, kCodec, , AMR_NB);
63 ASSERT_ENUM_EQ(AudioCodec, kCodec, , PCM_MULAW); 58 ASSERT_ENUM_EQ(AudioCodec, kCodec, , PCM_MULAW);
64 ASSERT_ENUM_EQ(AudioCodec, kCodec, , GSM_MS); 59 ASSERT_ENUM_EQ(AudioCodec, kCodec, , GSM_MS);
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 static_cast<media::VideoPixelFormat>(input->format), input->coded_size, 688 static_cast<media::VideoPixelFormat>(input->format), input->coded_size,
694 input->visible_rect, input->natural_size, std::move(input->frame_data), 689 input->visible_rect, input->natural_size, std::move(input->frame_data),
695 base::saturated_cast<size_t>(input->frame_data_size), 690 base::saturated_cast<size_t>(input->frame_data_size),
696 base::saturated_cast<size_t>(input->y_offset), 691 base::saturated_cast<size_t>(input->y_offset),
697 base::saturated_cast<size_t>(input->u_offset), 692 base::saturated_cast<size_t>(input->u_offset),
698 base::saturated_cast<size_t>(input->v_offset), input->y_stride, 693 base::saturated_cast<size_t>(input->v_offset), input->y_stride,
699 input->u_stride, input->v_stride, input->timestamp); 694 input->u_stride, input->v_stride, input->timestamp);
700 } 695 }
701 696
702 } // namespace mojo 697 } // namespace mojo
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_video_decoder.cc ('k') | media/mojo/interfaces/media_types.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698