OLD | NEW |
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 <stddef.h> |
| 6 #include <stdint.h> |
| 7 |
5 #include <cstdio> | 8 #include <cstdio> |
6 #include <cstdlib> | 9 #include <cstdlib> |
7 | 10 |
8 #include "base/logging.h" | 11 #include "base/logging.h" |
9 #include "media/base/video_frame.h" | 12 #include "media/base/video_frame.h" |
10 #include "media/cast/test/utility/barcode.h" | 13 #include "media/cast/test/utility/barcode.h" |
11 | 14 |
12 void DumpPlane(scoped_refptr<media::VideoFrame> frame, | 15 void DumpPlane(scoped_refptr<media::VideoFrame> frame, |
13 int plane) { | 16 int plane) { |
14 for (int row = 0; row < frame->rows(plane); row++) { | 17 for (int row = 0; row < frame->rows(plane); row++) { |
(...skipping 19 matching lines...) Expand all Loading... |
34 media::VideoFrame::CreateBlackFrame(gfx::Size(width, height)); | 37 media::VideoFrame::CreateBlackFrame(gfx::Size(width, height)); |
35 printf("YUV4MPEG2 W%d H%d F%d:1 Ip C420mpeg2\n", width, height, fps); | 38 printf("YUV4MPEG2 W%d H%d F%d:1 Ip C420mpeg2\n", width, height, fps); |
36 for (uint16_t frame_id = 1; frame_id <= wanted_frames; frame_id++) { | 39 for (uint16_t frame_id = 1; frame_id <= wanted_frames; frame_id++) { |
37 CHECK(media::cast::test::EncodeBarcode(frame_id, frame)); | 40 CHECK(media::cast::test::EncodeBarcode(frame_id, frame)); |
38 printf("FRAME\n"); | 41 printf("FRAME\n"); |
39 DumpPlane(frame, media::VideoFrame::kYPlane); | 42 DumpPlane(frame, media::VideoFrame::kYPlane); |
40 DumpPlane(frame, media::VideoFrame::kUPlane); | 43 DumpPlane(frame, media::VideoFrame::kUPlane); |
41 DumpPlane(frame, media::VideoFrame::kVPlane); | 44 DumpPlane(frame, media::VideoFrame::kVPlane); |
42 } | 45 } |
43 } | 46 } |
OLD | NEW |