Changeset 06e5daea61f283d5608de17742ed373a2e407b30
- Timestamp:
- 16/07/08 17:14:22
(5 months ago)
- Author:
- Derk-Jan Hartman <hartman@videolan.org>
- git-committer:
- Derk-Jan Hartman <hartman@videolan.org> 1216221262 +0200
- git-parent:
[c375cdfc27be5adb35008d91630a0702f986cf53]
- git-author:
- Derk-Jan Hartman <hartman@videolan.org> 1216221262 +0200
- Message:
Don't send blocks from qtcapture Demux that we have already sent before. Avoid excessive CPU usage while there are no new blocks.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc375cdf |
r06e5dae |
|
| 69 | 69 | CVImageBufferRef currentImageBuffer; |
|---|
| 70 | 70 | mtime_t currentPts; |
|---|
| | 71 | mtime_t previousPts; |
|---|
| 71 | 72 | } |
|---|
| 72 | 73 | - (id)init; |
|---|
| … | … | |
| 83 | 84 | currentImageBuffer = nil; |
|---|
| 84 | 85 | currentPts = 0; |
|---|
| | 86 | previousPts = 0; |
|---|
| 85 | 87 | } |
|---|
| 86 | 88 | return self; |
|---|
| … | … | |
| 118 | 120 | mtime_t pts; |
|---|
| 119 | 121 | |
|---|
| 120 | | if(!currentImageBuffer) |
|---|
| | 122 | if(!currentImageBuffer || currentPts == previousPts ) |
|---|
| 121 | 123 | return 0; |
|---|
| 122 | 124 | |
|---|
| … | … | |
| 124 | 126 | { |
|---|
| 125 | 127 | imageBuffer = CVBufferRetain(currentImageBuffer); |
|---|
| 126 | | pts = currentPts; |
|---|
| | 128 | pts = previousPts = currentPts; |
|---|
| 127 | 129 | |
|---|
| 128 | 130 | CVPixelBufferLockBaseAddress(imageBuffer, 0); |
|---|
| … | … | |
| 354 | 356 | block_Release( p_block ); |
|---|
| 355 | 357 | [pool release]; |
|---|
| | 358 | msleep( 10000 ); |
|---|
| 356 | 359 | return 1; |
|---|
| 357 | 360 | } |
|---|