~ubuntu-branches/debian/experimental/kopete/experimental

« back to all changes in this revision

Viewing changes to protocols/jabber/libjingle/talk/session/phone/v4llookup.h

  • Committer: Package Import Robot
  • Author(s): Maximiliano Curia
  • Date: 2015-02-24 11:32:57 UTC
  • mfrom: (1.1.41 vivid)
  • Revision ID: package-import@ubuntu.com-20150224113257-gnupg4v7lzz18ij0
Tags: 4:14.12.2-1
* New upstream release (14.12.2).
* Bump Standards-Version to 3.9.6, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2009, Google Inc.
 
3
 * Author: lexnikitin@google.com (Alexey Nikitin)
 
4
 *
 
5
 * V4LLookup provides basic functionality to work with V2L2 devices in Linux
 
6
 * The functionality is implemented as a class with virtual methods for
 
7
 * the purpose of unit testing.
 
8
 */
 
9
#ifndef TALK_SESSION_PHONE_V4LLOOKUP_H_
 
10
#define TALK_SESSION_PHONE_V4LLOOKUP_H_
 
11
 
 
12
#include <string>
 
13
 
 
14
#ifdef LINUX
 
15
namespace cricket {
 
16
class V4LLookup {
 
17
 public:
 
18
  virtual ~V4LLookup() {}
 
19
 
 
20
  static bool IsV4L2Device(const std::string& device_path) {
 
21
    return GetV4LLookup()->CheckIsV4L2Device(device_path);
 
22
  }
 
23
 
 
24
  static void SetV4LLookup(V4LLookup* v4l_lookup) {
 
25
    v4l_lookup_ = v4l_lookup;
 
26
  }
 
27
 
 
28
  static V4LLookup* GetV4LLookup() {
 
29
    if (!v4l_lookup_) {
 
30
      v4l_lookup_ = new V4LLookup();
 
31
    }
 
32
    return v4l_lookup_;
 
33
  }
 
34
 
 
35
 protected:
 
36
  static V4LLookup* v4l_lookup_;
 
37
  // Making virtual so it is easier to mock
 
38
  virtual bool CheckIsV4L2Device(const std::string& device_path);
 
39
};
 
40
 
 
41
}  // namespace cricket
 
42
 
 
43
#endif  // LINUX
 
44
#endif  // TALK_SESSION_PHONE_V4LLOOKUP_H_