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

Side by Side Diff: remoting/base/decoder_vp8.h

Issue 9320025: Introducing a helper wrapper for YUV-to-RGB convertion and/or scaling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More review feedback. Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « media/base/yuv_convert.cc ('k') | remoting/base/decoder_vp8.cc » ('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 (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 REMOTING_BASE_DECODER_VP8_H_ 5 #ifndef REMOTING_BASE_DECODER_VP8_H_
6 #define REMOTING_BASE_DECODER_VP8_H_ 6 #define REMOTING_BASE_DECODER_VP8_H_
7 7
8 #include "remoting/base/decoder.h" 8 #include "remoting/base/decoder.h"
9 9
10 typedef struct vpx_codec_ctx vpx_codec_ctx_t; 10 typedef struct vpx_codec_ctx vpx_codec_ctx_t;
(...skipping 17 matching lines...) Expand all
28 virtual void SetClipRect(const SkIRect& clip_rect) OVERRIDE; 28 virtual void SetClipRect(const SkIRect& clip_rect) OVERRIDE;
29 virtual void RefreshRegion(const SkRegion& region) OVERRIDE; 29 virtual void RefreshRegion(const SkRegion& region) OVERRIDE;
30 30
31 private: 31 private:
32 enum State { 32 enum State {
33 kUninitialized, 33 kUninitialized,
34 kReady, 34 kReady,
35 kError, 35 kError,
36 }; 36 };
37 37
38 // Return true if scaling is enabled
39 bool DoScaling() const;
40
41 // Perform color space conversion on the specified region.
42 // Writes the updated region to |output_region|.
43 void ConvertRegion(const SkRegion& region,
44 SkRegion* output_region);
45
46 // Perform scaling and color space conversion on the specified
47 // region. Writes the updated rectangles to |output_region|.
48 void ScaleAndConvertRegion(const SkRegion& region,
49 SkRegion* output_region);
50
51 // The internal state of the decoder. 38 // The internal state of the decoder.
52 State state_; 39 State state_;
53 40
54 // The video frame to write to. 41 // The video frame to write to.
55 scoped_refptr<media::VideoFrame> frame_; 42 scoped_refptr<media::VideoFrame> frame_;
56 43
57 vpx_codec_ctx_t* codec_; 44 vpx_codec_ctx_t* codec_;
58 45
59 // Pointer to the last decoded image. 46 // Pointer to the last decoded image.
60 vpx_image_t* last_image_; 47 vpx_image_t* last_image_;
61 48
62 // The region updated by the most recent decode. 49 // The region updated by the most recent decode.
63 SkRegion updated_region_; 50 SkRegion updated_region_;
64 51
65 // Clipping rect for the output of the decoder. 52 // Clipping rect for the output of the decoder.
66 SkIRect clip_rect_; 53 SkIRect clip_rect_;
67 54
68 // Output dimensions. 55 // Output dimensions.
69 SkISize output_size_; 56 SkISize output_size_;
70 57
71 DISALLOW_COPY_AND_ASSIGN(DecoderVp8); 58 DISALLOW_COPY_AND_ASSIGN(DecoderVp8);
72 }; 59 };
73 60
74 } // namespace remoting 61 } // namespace remoting
75 62
76 #endif // REMOTING_BASE_DECODER_VP8_H_ 63 #endif // REMOTING_BASE_DECODER_VP8_H_
OLDNEW
« no previous file with comments | « media/base/yuv_convert.cc ('k') | remoting/base/decoder_vp8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698