| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 static const uint32_t kFrameHeaderSize = 40; // Size from width to data_size. | 71 static const uint32_t kFrameHeaderSize = 40; // Size from width to data_size. |
| 72 static const uint32_t kUnknownDataSize = 0xFFFFFFFF; | 72 static const uint32_t kUnknownDataSize = 0xFFFFFFFF; |
| 73 | 73 |
| 74 CapturedFrame(); | 74 CapturedFrame(); |
| 75 | 75 |
| 76 // Get the number of bytes of the frame data. If data_size is known, return | 76 // Get the number of bytes of the frame data. If data_size is known, return |
| 77 // it directly. Otherwise, calculate the size based on width, height, and | 77 // it directly. Otherwise, calculate the size based on width, height, and |
| 78 // fourcc. Return true if succeeded. | 78 // fourcc. Return true if succeeded. |
| 79 bool GetDataSize(uint32_t* size) const; | 79 bool GetDataSize(uint32_t* size) const; |
| 80 | 80 |
| 81 // TODO(guoweis): Change the type of |rotation| from int to | |
| 82 // webrtc::VideoRotation once chromium gets the code. | |
| 83 webrtc::VideoRotation GetRotation() const; | |
| 84 | |
| 85 // The width and height of the captured frame could be different from those | 81 // The width and height of the captured frame could be different from those |
| 86 // of VideoFormat. Once the first frame is captured, the width, height, | 82 // of VideoFormat. Once the first frame is captured, the width, height, |
| 87 // fourcc, pixel_width, and pixel_height should keep the same over frames. | 83 // fourcc, pixel_width, and pixel_height should keep the same over frames. |
| 88 int width; // in number of pixels | 84 int width; // in number of pixels |
| 89 int height; // in number of pixels | 85 int height; // in number of pixels |
| 90 uint32_t fourcc; // compression | 86 uint32_t fourcc; // compression |
| 91 uint32_t pixel_width; // width of a pixel, default is 1 | 87 uint32_t pixel_width; // width of a pixel, default is 1 |
| 92 uint32_t pixel_height; // height of a pixel, default is 1 | 88 uint32_t pixel_height; // height of a pixel, default is 1 |
| 93 // TODO(magjed): |elapsed_time| is deprecated - remove once not used anymore. | |
| 94 int64_t elapsed_time; | |
| 95 int64_t time_stamp; // timestamp of when the frame was captured, in unix | 89 int64_t time_stamp; // timestamp of when the frame was captured, in unix |
| 96 // time with nanosecond units. | 90 // time with nanosecond units. |
| 97 uint32_t data_size; // number of bytes of the frame data | 91 uint32_t data_size; // number of bytes of the frame data |
| 98 | 92 |
| 99 // TODO(guoweis): This can't be converted to VideoRotation yet as it's | 93 webrtc::VideoRotation rotation; // rotation in degrees of the frame. |
| 100 // used by chrome now. | |
| 101 int rotation; // rotation in degrees of the frame (0, 90, 180, 270) | |
| 102 | 94 |
| 103 void* data; // pointer to the frame data. This object allocates the | 95 void* data; // pointer to the frame data. This object allocates the |
| 104 // memory or points to an existing memory. | 96 // memory or points to an existing memory. |
| 105 | 97 |
| 106 private: | 98 private: |
| 107 RTC_DISALLOW_COPY_AND_ASSIGN(CapturedFrame); | 99 RTC_DISALLOW_COPY_AND_ASSIGN(CapturedFrame); |
| 108 }; | 100 }; |
| 109 | 101 |
| 110 // VideoCapturer is an abstract class that defines the interfaces for video | 102 // VideoCapturer is an abstract class that defines the interfaces for video |
| 111 // capturing. The subclasses implement the video capturer for various types of | 103 // capturing. The subclasses implement the video capturer for various types of |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 388 |
| 397 // Whether capturer should apply rotation to the frame before signaling it. | 389 // Whether capturer should apply rotation to the frame before signaling it. |
| 398 bool apply_rotation_; | 390 bool apply_rotation_; |
| 399 | 391 |
| 400 RTC_DISALLOW_COPY_AND_ASSIGN(VideoCapturer); | 392 RTC_DISALLOW_COPY_AND_ASSIGN(VideoCapturer); |
| 401 }; | 393 }; |
| 402 | 394 |
| 403 } // namespace cricket | 395 } // namespace cricket |
| 404 | 396 |
| 405 #endif // TALK_MEDIA_BASE_VIDEOCAPTURER_H_ | 397 #endif // TALK_MEDIA_BASE_VIDEOCAPTURER_H_ |
| OLD | NEW |