00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <mxcpcDefaultMxPEGDecoderBackEnd.h>
00021 #include <mxcpc_namespace.h>
00022
00023 #include <cstdlib>
00024 #include <cstdio>
00025
00026
00027
00028 mxcpcDefaultMxPEGDecoderBackEnd::mxcpcDefaultMxPEGDecoderBackEnd() {
00029
00030 ReceivedFrames = 0;
00031 TileNum = 0;
00032
00033 ErrorEncountered = false;
00034 }
00035
00036
00037
00038 void mxcpcDefaultMxPEGDecoderBackEnd::videoResolutionChanged(int width,
00039 int height) {
00040
00041 char txt[100];
00042
00043 std::sprintf(txt, "mxcpcDefaultMxPEGDecoderBackEnd : "
00044 "video resolution changed to %dx%d.", width, height);
00045 mxcpc::sendStatusMsg(txt);
00046 }
00047
00048
00049 void mxcpcDefaultMxPEGDecoderBackEnd::errorEncountered(void) {
00050
00051 ErrorEncountered = true;
00052 }
00053
00054
00055 void mxcpcDefaultMxPEGDecoderBackEnd::frameComplete(void) {
00056
00057 char txt[100];
00058
00059 ReceivedFrames++;
00060
00061 if(!ErrorEncountered)
00062 std::sprintf(txt, "mxcpcDefaultMxPEGDecoderBackEnd : "
00063 "------ video frame #%d with %d tiles OK ------",
00064 ReceivedFrames, TileNum);
00065 else
00066 std::sprintf(txt, "@@@@@@@@ mxcpcDefaultMxPEGDecoderBackEnd : CORRUPT FRAME");
00067
00068 mxcpc::sendStatusMsg(txt);
00069
00070
00071 TileNum = 0;
00072 ErrorEncountered = false;
00073 }
00074
00075
00076 void mxcpcDefaultMxPEGDecoderBackEnd::provideVideoTilePixelTarget(
00077 int tile_x, int tile_y,
00078 mxcpc::u32 **target_ptr,
00079 int *row_stepping_ptr) {
00080
00081 *target_ptr = (mxcpc::u32 *)TilePixelBuffer;
00082 *row_stepping_ptr = 0;
00083 }
00084
00085
00086 void mxcpcDefaultMxPEGDecoderBackEnd::videoTileReceived(void) {
00087
00088 TileNum++;
00089 }
00090
00091
00092 int mxcpcDefaultMxPEGDecoderBackEnd::getDecodedFramesNum(void) {
00093
00094 return(ReceivedFrames);
00095 }
00096