~zaspire/oxide/camera_qtmultimedia

« back to all changes in this revision

Viewing changes to qt/core/media/oxide_qt_video_capture_device.h

  • Committer: Maxim Ermilov
  • Date: 2015-04-20 07:57:39 UTC
  • Revision ID: maxim.ermilov@canonical.com-20150420075739-b629obl2en8cax2w
override VideoCaptureDeviceFactory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vim:expandtab:shiftwidth=2:tabstop=2:
 
2
// Copyright (C) 2014-2015 Canonical Ltd.
 
3
 
 
4
// This library is free software; you can redistribute it and/or
 
5
// modify it under the terms of the GNU Lesser General Public
 
6
// License as published by the Free Software Foundation; either
 
7
// version 2.1 of the License, or (at your option) any later version.
 
8
 
 
9
// This library is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
// Lesser General Public License for more details.
 
13
 
 
14
// You should have received a copy of the GNU Lesser General Public
 
15
// License along with this library; if not, write to the Free Software
 
16
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 
 
18
#ifndef OXIDE_MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_
 
19
#define OXIDE_MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_
 
20
 
 
21
#include <string>
 
22
 
 
23
#include "base/files/file_util.h"
 
24
#include "base/files/scoped_file.h"
 
25
#include "base/threading/thread.h"
 
26
#include "media/base/video_capture_types.h"
 
27
#include "media/video/capture/video_capture_device.h"
 
28
 
 
29
#include <QtCore>
 
30
#include <QtMultimedia>
 
31
 
 
32
namespace oxide {
 
33
namespace qt {
 
34
class CameraFrameGrabber;
 
35
 
 
36
class VideoCaptureDevice : public media::VideoCaptureDevice {
 
37
 public:
 
38
  explicit VideoCaptureDevice(const media::VideoCaptureDevice::Name& device_name);
 
39
  ~VideoCaptureDevice() override;
 
40
 
 
41
  void AllocateAndStart(const media::VideoCaptureParams& params,
 
42
                        scoped_ptr<Client> client) override;
 
43
  void StopAndDeAllocate() override;
 
44
 private:
 
45
  QCamera camera_;
 
46
  QThread thread_;
 
47
  scoped_ptr<CameraFrameGrabber> viewFinder_;
 
48
 
 
49
  DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDevice);
 
50
};
 
51
 
 
52
}
 
53
}
 
54
 
 
55
#endif