1 /* 2 * Copyright 2009, Google Inc. 3 * Author: lexnikitin (at) 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 return v4l_lookup_; 30 } 31 32 protected: 33 static V4LLookup* v4l_lookup_; 34 // Making virtual so it is easier to mock 35 virtual bool CheckIsV4L2Device(const std::string& device_path); 36 37 }; 38 } // namespace cricket 39 #endif 40 #endif // TALK_SESSION_PHONE_V4LLOOKUP_H_ 41