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