Remove decoding thread like in Java common

This commit is contained in:
Cameron Gutman
2014-06-29 00:24:25 -07:00
parent 97710478de
commit 50733f6d7a
6 changed files with 51 additions and 30 deletions
-23
View File
@@ -18,7 +18,6 @@ static SOCKET firstFrameSocket = INVALID_SOCKET;
static PLT_THREAD udpPingThread;
static PLT_THREAD receiveThread;
static PLT_THREAD decoderThread;
void initializeVideoStream(IP_ADDRESS host, PSTREAM_CONFIGURATION streamConfig, PDECODER_RENDERER_CALLBACKS drCallbacks,
PCONNECTION_LISTENER_CALLBACKS clCallbacks) {
@@ -83,20 +82,6 @@ static void ReceiveThreadProc(void* context) {
free(buffer);
}
static void DecoderThreadProc(void* context) {
PDECODE_UNIT du;
while (!PltIsThreadInterrupted(&decoderThread)) {
if (!getNextDecodeUnit(&du)) {
printf("Decoder thread terminating\n");
return;
}
callbacks.submitDecodeUnit(du);
freeDecodeUnit(du);
}
}
int readFirstFrame(void) {
char* firstFrame;
int err;
@@ -133,7 +118,6 @@ void stopVideoStream(void) {
PltInterruptThread(&udpPingThread);
PltInterruptThread(&receiveThread);
PltInterruptThread(&decoderThread);
if (firstFrameSocket != INVALID_SOCKET) {
closesocket(firstFrameSocket);
@@ -146,11 +130,9 @@ void stopVideoStream(void) {
PltJoinThread(&udpPingThread);
PltJoinThread(&receiveThread);
PltJoinThread(&decoderThread);
PltCloseThread(&udpPingThread);
PltCloseThread(&receiveThread);
PltCloseThread(&decoderThread);
}
int startVideoStream(void* rendererContext, int drFlags) {
@@ -176,11 +158,6 @@ int startVideoStream(void* rendererContext, int drFlags) {
return err;
}
err = PltCreateThread(DecoderThreadProc, NULL, &decoderThread);
if (err != 0) {
return err;
}
callbacks.start();
return 0;