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

Side by Side Diff: webrtc/media/devices/gtkvideorenderer.h

Issue 1728503002: Replace scoped_ptr with unique_ptr in webrtc/media/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@up1
Patch Set: Created 4 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
« no previous file with comments | « webrtc/media/devices/gdivideorenderer.cc ('k') | webrtc/media/devices/linuxdeviceinfo.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 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 // Definition of class GtkVideoRenderer that implements the abstract class 11 // Definition of class GtkVideoRenderer that implements the abstract class
12 // cricket::VideoRenderer via GTK. 12 // cricket::VideoRenderer via GTK.
13 13
14 #ifndef WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_ 14 #ifndef WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
15 #define WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_ 15 #define WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
16 16
17 #include <memory>
18
17 #include "webrtc/base/basictypes.h" 19 #include "webrtc/base/basictypes.h"
18 #include "webrtc/base/scoped_ptr.h"
19 #include "webrtc/media/base/videorenderer.h" 20 #include "webrtc/media/base/videorenderer.h"
20 21
21 typedef struct _GtkWidget GtkWidget; // forward declaration, defined in gtk.h 22 typedef struct _GtkWidget GtkWidget; // forward declaration, defined in gtk.h
22 23
23 namespace cricket { 24 namespace cricket {
24 25
25 class GtkVideoRenderer : public VideoRenderer { 26 class GtkVideoRenderer : public VideoRenderer {
26 public: 27 public:
27 GtkVideoRenderer(int x, int y); 28 GtkVideoRenderer(int x, int y);
28 virtual ~GtkVideoRenderer(); 29 virtual ~GtkVideoRenderer();
29 30
30 // Implementation of pure virtual methods of VideoRenderer. 31 // Implementation of pure virtual methods of VideoRenderer.
31 // These two methods may be executed in different threads. 32 // These two methods may be executed in different threads.
32 // SetSize is called before RenderFrame. 33 // SetSize is called before RenderFrame.
33 virtual bool SetSize(int width, int height, int reserved); 34 virtual bool SetSize(int width, int height, int reserved);
34 virtual bool RenderFrame(const VideoFrame* frame); 35 virtual bool RenderFrame(const VideoFrame* frame);
35 36
36 private: 37 private:
37 // Initialize the attributes when the first frame arrives. 38 // Initialize the attributes when the first frame arrives.
38 bool Initialize(int width, int height); 39 bool Initialize(int width, int height);
39 // Pump the Gtk event loop until there are no events left. 40 // Pump the Gtk event loop until there are no events left.
40 void Pump(); 41 void Pump();
41 // Check if the window has been closed. 42 // Check if the window has been closed.
42 bool IsClosed() const; 43 bool IsClosed() const;
43 44
44 rtc::scoped_ptr<uint8_t[]> image_; 45 std::unique_ptr<uint8_t[]> image_;
45 GtkWidget* window_; 46 GtkWidget* window_;
46 GtkWidget* draw_area_; 47 GtkWidget* draw_area_;
47 // The initial position of the window. 48 // The initial position of the window.
48 int initial_x_; 49 int initial_x_;
49 int initial_y_; 50 int initial_y_;
50 51
51 int width_; 52 int width_;
52 int height_; 53 int height_;
53 }; 54 };
54 55
55 } // namespace cricket 56 } // namespace cricket
56 57
57 #endif // WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_ 58 #endif // WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
OLDNEW
« no previous file with comments | « webrtc/media/devices/gdivideorenderer.cc ('k') | webrtc/media/devices/linuxdeviceinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698