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

Side by Side Diff: media/gpu/h264_decoder.h

Issue 2926593002: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client (Closed)
Patch Set: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client Created 3 years, 6 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 | « no previous file | media/gpu/h264_decoder.cc » ('j') | media/gpu/vp8_decoder.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef MEDIA_GPU_H264_DECODER_H_ 5 #ifndef MEDIA_GPU_H264_DECODER_H_
6 #define MEDIA_GPU_H264_DECODER_H_ 6 #define MEDIA_GPU_H264_DECODER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "media/base/limits.h" 16 #include "media/base/limits.h"
17 #include "media/filters/h264_parser.h" 17 #include "media/filters/h264_parser.h"
18 #include "media/gpu/accelerated_video_decoder.h" 18 #include "media/gpu/accelerated_video_decoder.h"
19 #include "media/gpu/h264_dpb.h" 19 #include "media/gpu/h264_dpb.h"
20 #include "media/gpu/media_gpu_export.h" 20 #include "media/gpu/media_gpu_export.h"
21 #include "ui/gfx/geometry/rect.h"
21 #include "ui/gfx/geometry/size.h" 22 #include "ui/gfx/geometry/size.h"
22 23
23 namespace media { 24 namespace media {
24 25
25 // Clients of this class are expected to pass H264 Annex-B byte stream 26 // Clients of this class are expected to pass H264 Annex-B byte stream
26 // and are expected to provide an implementation of H264Accelerator for 27 // and are expected to provide an implementation of H264Accelerator for
27 // offloading final steps of the decoding process. 28 // offloading final steps of the decoding process.
28 // 29 //
29 // This class must be created, called and destroyed on a single thread, and 30 // This class must be created, called and destroyed on a single thread, and
30 // does nothing internally on any other thread. 31 // does nothing internally on any other thread.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // the previous call to SubmitDecode(). 84 // the previous call to SubmitDecode().
84 // Return true if successful. 85 // Return true if successful.
85 virtual bool SubmitDecode(const scoped_refptr<H264Picture>& pic) = 0; 86 virtual bool SubmitDecode(const scoped_refptr<H264Picture>& pic) = 0;
86 87
87 // Schedule output (display) of |pic|. Note that returning from this 88 // Schedule output (display) of |pic|. Note that returning from this
88 // method does not mean that |pic| has already been outputted (displayed), 89 // method does not mean that |pic| has already been outputted (displayed),
89 // but guarantees that all pictures will be outputted in the same order 90 // but guarantees that all pictures will be outputted in the same order
90 // as this method was called for them. Decoder may drop its reference 91 // as this method was called for them. Decoder may drop its reference
91 // to |pic| after calling this method. 92 // to |pic| after calling this method.
92 // Return true if successful. 93 // Return true if successful.
93 virtual bool OutputPicture(const scoped_refptr<H264Picture>& pic) = 0; 94 virtual bool OutputPicture(const scoped_refptr<H264Picture>& pic,
95 const gfx::Rect& visible_rect) = 0;
Pawel Osciak 2017/06/08 04:58:24 Please document |visible_rect| (especially the mea
johnylin1 2017/06/12 13:41:53 This is removed in newer patch, I document visible
94 96
95 // Reset any current state that may be cached in the accelerator, dropping 97 // Reset any current state that may be cached in the accelerator, dropping
96 // any cached parameters/slices that have not been committed yet. 98 // any cached parameters/slices that have not been committed yet.
97 virtual void Reset() = 0; 99 virtual void Reset() = 0;
98 100
99 private: 101 private:
100 DISALLOW_COPY_AND_ASSIGN(H264Accelerator); 102 DISALLOW_COPY_AND_ASSIGN(H264Accelerator);
101 }; 103 };
102 104
103 H264Decoder(H264Accelerator* accelerator); 105 H264Decoder(H264Accelerator* accelerator);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Currently active SPS and PPS. 261 // Currently active SPS and PPS.
260 int curr_sps_id_; 262 int curr_sps_id_;
261 int curr_pps_id_; 263 int curr_pps_id_;
262 264
263 // Current NALU and slice header being processed. 265 // Current NALU and slice header being processed.
264 std::unique_ptr<H264NALU> curr_nalu_; 266 std::unique_ptr<H264NALU> curr_nalu_;
265 std::unique_ptr<H264SliceHeader> curr_slice_hdr_; 267 std::unique_ptr<H264SliceHeader> curr_slice_hdr_;
266 268
267 // Output picture size. 269 // Output picture size.
268 gfx::Size pic_size_; 270 gfx::Size pic_size_;
271 // Output visible cropping rect.
272 gfx::Rect visible_rect_;
269 273
270 // PicOrderCount of the previously outputted frame. 274 // PicOrderCount of the previously outputted frame.
271 int last_output_poc_; 275 int last_output_poc_;
272 276
273 H264Accelerator* accelerator_; 277 H264Accelerator* accelerator_;
274 278
275 DISALLOW_COPY_AND_ASSIGN(H264Decoder); 279 DISALLOW_COPY_AND_ASSIGN(H264Decoder);
276 }; 280 };
277 281
278 } // namespace media 282 } // namespace media
279 283
280 #endif // MEDIA_GPU_H264_DECODER_H_ 284 #endif // MEDIA_GPU_H264_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | media/gpu/h264_decoder.cc » ('j') | media/gpu/vp8_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698