Revision 37fc5455
chunker_player/player_core.c | ||
---|---|---|
92 | 92 |
long int decoded_vframes; |
93 | 93 |
long int LastSavedVFrame; |
94 | 94 |
|
95 |
int tcrop = 0; |
|
96 |
int bcrop = 0; |
|
97 |
|
|
95 | 98 |
void SaveFrame(AVFrame *pFrame, int width, int height); |
96 | 99 |
int VideoCallback(void *valthread); |
97 | 100 |
int CollectStatisticsThread(void *params); |
... | ... | |
495 | 498 |
return -1; |
496 | 499 |
} |
497 | 500 |
|
498 |
av_log_set_level(AV_LOG_FATAL);
|
|
501 |
av_log_set_level(AV_LOG_ERROR);
|
|
499 | 502 |
|
500 | 503 |
sprintf(audio_stats, "waiting for incoming audio packets..."); |
501 | 504 |
sprintf(video_stats, "waiting for incoming video packets..."); |
... | ... | |
829 | 832 |
return audio_pkt_size; |
830 | 833 |
} |
831 | 834 |
|
835 |
|
|
836 |
void ChunkerPlayerCore_SetYCrop(int t, int b){ |
|
837 |
tcrop = t; |
|
838 |
bcrop = b; |
|
839 |
} |
|
840 |
|
|
832 | 841 |
// Render a Frame to a YUV Overlay. Note that the Overlay is already bound to an SDL Surface |
833 | 842 |
// Note that width, height would not be needed in new ffmpeg versions where this info is contained in AVFrame |
834 | 843 |
// see: [FFmpeg-devel] [PATCH] lavc: add width and height fields to AVFrame |
... | ... | |
1085 | 1094 |
continue; |
1086 | 1095 |
|
1087 | 1096 |
SDL_LockMutex(OverlayMutex); |
1088 |
if (RenderFrame2Overlay(pFrame, pCodecCtx->width, pCodecCtx->height, 0, 0, YUVOverlay) < 0){
|
|
1097 |
if (RenderFrame2Overlay(pFrame, pCodecCtx->width, pCodecCtx->height, tcrop, bcrop, YUVOverlay) < 0){
|
|
1089 | 1098 |
SDL_UnlockMutex(OverlayMutex); |
1090 | 1099 |
continue; |
1091 | 1100 |
} |
chunker_player/player_core.h | ||
---|---|---|
20 | 20 |
int ChunkerPlayerCore_EnqueueBlocks(const uint8_t *block, const int block_size); |
21 | 21 |
void ChunkerPlayerCore_SetupOverlay(int width, int height); |
22 | 22 |
void ChunkerPlayerCore_ChangeDelay(int ms); // positive to increase delay |
23 |
void ChunkerPlayerCore_SetYCrop(int tcrop, int bcrop); |
|
23 | 24 |
|
24 | 25 |
#endif // _CHUNKER_PLAYER_CORE_H |
Also available in: Unified diff