| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const rtc::scoped_refptr<AndroidVideoCapturerDelegate>& delegate); | 62 const rtc::scoped_refptr<AndroidVideoCapturerDelegate>& delegate); |
| 63 virtual ~AndroidVideoCapturer(); | 63 virtual ~AndroidVideoCapturer(); |
| 64 | 64 |
| 65 // Called from JNI when the capturer has been started. | 65 // Called from JNI when the capturer has been started. |
| 66 void OnCapturerStarted(bool success); | 66 void OnCapturerStarted(bool success); |
| 67 | 67 |
| 68 // Called from JNI when a new frame has been captured. | 68 // Called from JNI when a new frame has been captured. |
| 69 // Argument |buffer| is intentionally by value, for use with rtc::Bind. | 69 // Argument |buffer| is intentionally by value, for use with rtc::Bind. |
| 70 void OnIncomingFrame(rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer, | 70 void OnIncomingFrame(rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer, |
| 71 int rotation, | 71 int rotation, |
| 72 int64 time_stamp); | 72 int64_t time_stamp); |
| 73 | 73 |
| 74 // Called from JNI to request a new video format. | 74 // Called from JNI to request a new video format. |
| 75 void OnOutputFormatRequest(int width, int height, int fps); | 75 void OnOutputFormatRequest(int width, int height, int fps); |
| 76 | 76 |
| 77 AndroidVideoCapturerDelegate* delegate() { return delegate_.get(); } | 77 AndroidVideoCapturerDelegate* delegate() { return delegate_.get(); } |
| 78 | 78 |
| 79 // cricket::VideoCapturer implementation. | 79 // cricket::VideoCapturer implementation. |
| 80 bool GetBestCaptureFormat(const cricket::VideoFormat& desired, | 80 bool GetBestCaptureFormat(const cricket::VideoFormat& desired, |
| 81 cricket::VideoFormat* best_format) override; | 81 cricket::VideoFormat* best_format) override; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 // cricket::VideoCapturer implementation. | 84 // cricket::VideoCapturer implementation. |
| 85 // Video frames will be delivered using | 85 // Video frames will be delivered using |
| 86 // cricket::VideoCapturer::SignalFrameCaptured on the thread that calls Start. | 86 // cricket::VideoCapturer::SignalFrameCaptured on the thread that calls Start. |
| 87 cricket::CaptureState Start( | 87 cricket::CaptureState Start( |
| 88 const cricket::VideoFormat& capture_format) override; | 88 const cricket::VideoFormat& capture_format) override; |
| 89 void Stop() override; | 89 void Stop() override; |
| 90 bool IsRunning() override; | 90 bool IsRunning() override; |
| 91 bool IsScreencast() const override { return false; } | 91 bool IsScreencast() const override { return false; } |
| 92 bool GetPreferredFourccs(std::vector<uint32>* fourccs) override; | 92 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override; |
| 93 | 93 |
| 94 bool running_; | 94 bool running_; |
| 95 rtc::scoped_refptr<AndroidVideoCapturerDelegate> delegate_; | 95 rtc::scoped_refptr<AndroidVideoCapturerDelegate> delegate_; |
| 96 | 96 |
| 97 rtc::ThreadChecker thread_checker_; | 97 rtc::ThreadChecker thread_checker_; |
| 98 | 98 |
| 99 class FrameFactory; | 99 class FrameFactory; |
| 100 FrameFactory* frame_factory_; // Owned by cricket::VideoCapturer. | 100 FrameFactory* frame_factory_; // Owned by cricket::VideoCapturer. |
| 101 | 101 |
| 102 cricket::CaptureState current_state_; | 102 cricket::CaptureState current_state_; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace webrtc | 105 } // namespace webrtc |
| 106 | 106 |
| 107 #endif // TALK_APP_WEBRTC_ANDROIDVIDEOCAPTURER_H_ | 107 #endif // TALK_APP_WEBRTC_ANDROIDVIDEOCAPTURER_H_ |
| OLD | NEW |