   SMPEG
  Hi all,I'm having some issues with SMPEG.I'm writing a multimedia app in C++ on linux. The purpose of this application is to show different elements on a screen(images, video, text). I have different classes to represent each of these. My problem has to do with with my video class. (It's rather large so I've only inlcuded the functions that seem to be causing the problem)I get poor video playback when I have other stuff on the screen showing with the video...and i also get this message somtimes but not all the time:Xlib: unexpected async reply (sequence 0x12)!#ifndef BB_ELEMENT_H#define BB_ELEMENT_H#include "BB_types.h"#include "BB_timer.h"#include "SDL_ttf.h"#include "SDL_image.h"#include "debug.h"#include &lt;string&gt;#ifndef NULL#define NULL 0#endifextern const std::string $_CONTENT;const int DEFAULT_ALPHA=255;const int DEFAULT_W=300;const int DEFAULT_H=200;const int DEFAULT_X=0;const int DEFAULT_Y=0;const std::string DEFAULT_FONT="fonts/font.ttf";extern const std::string CONTENT_DIR;class BB_element{protected:int alpha;enum BB_type type;BB_Language lang;BB_Timer* timer;//pointeur vers un timer qui est instancie au debutSDL_Surface *BB_Content;SDL_Rect Offset;SDL_Rect Clip;BB_element* parent;public:virtual ~BB_element(){  timer=NULL;parent=0;printf("Base class destructor\n");};BB_element(){Offset.x=DEFAULT_X;Offset.y=DEFAULT_Y;Offset.h=DEFAULT_H;Offset.w=DEFAULT_W;type=UNDEFINED;lang=francais;alpha=DEFAULT_ALPHA;Clip.h=0;Clip.w=0;Clip.x=0;Clip.y=0;BB_Content=NULL;timer=NULL;parent=NULL;}BB_element(int n_x, int n_y, int n_w, int n_h, BB_type n_type){//initialiser l'objet Offset.x=n_x;Offset.y=n_y;Offset.w=n_w;Offset.h=n_h;Clip.x=n_x;Clip.y=n_y;Clip.w=n_w;Clip.h=n_h;type=n_type;alpha=0;BB_Content=NULL;timer=NULL;parent=NULL;}virtual int BB_update()=0;virtual int BB_element_init()=0;virtual void BB_pause(){};//getint BB_get_x()const{return Offset.x;}int BB_get_y()const{return Offset.y;}int BB_get_w()const{return Offset.w;}int BB_get_h()const{return Offset.h;}SDL_Surface* BB_get_content() const {return BB_Content;}BB_type BB_get_type()const{return type;}BB_Language BB_get_lang()const{return lang;}//setvoid BB_set_x(int n_x){Offset.x=n_x;}void BB_set_y(int n_y){Offset.y=n_y;}void BB_set_w(int n_w){Offset.w=n_w;}void BB_set_h(int n_h){Offset.h=n_h;}void BB_set_type(BB_type n_type){type=n_type;}void BB_set_timer(BB_Timer* n_timer){timer=n_timer;}void BB_set_lang(BB_Language n_lang){lang=n_lang;}void BB_set_alpha(int n_alpha){alpha=n_alpha;}void BB_set_parent(BB_element* p){parent=p;}void BB_apply_surface(SDL_Rect* Pos,SDL_Surface* source, SDL_Surface* destination );};#endif////HERE'S THE BB_APPLY_SURFACE IMPLEMENTATIONvoidBB_element::BB_apply_surface(SDL_Rect* Pos,SDL_Surface* source, SDL_Surface* destination ){   SDL_SetAlpha(source, SDL_SRCALPHA, alpha);//VERIFIER S'IL FAUT FAIRE UN CLIPPINGif(Clip.w!=0&&Clip.h!=0){SDL_SetClipRect(destination, &Clip);}elseSDL_SetClipRect(destination, NULL);//SDL_LockSurface(SDL_GetVideoSurface());if(Pos==NULL)SDL_BlitSurface( source, NULL, destination, &Offset );elseSDL_BlitSurface( source, NULL, destination, Pos );//SDL_UnlockSurface(SDL_GetVideoSurface());}//THIS IS THE HEADER FILE FOR THE VIDEO ELEMENT#ifndef BB_VIDEO_ELEMENT_H#define BB_VIDEO_ELEMENT_H//SMPEG#include "smpeg.h" #include "BB_video_playlist.h" #include "BB_image_element.h" class BB_video_element:public BB_element{private:SMPEG_Info movieInfo;BB_image_element* banner;SMPEG *movie;bool m_bInit;public:BB_video_playlist* v_playlist;//fix :: pas mettre la playlist public~BB_video_element();BB_video_element();int BB_element_init();int BB_update();static void updateMPEGFrame(SDL_Surface *buffer, Sint32 x, Sint32 y,Uint32 w, Uint32 h);void BB_pause();void CheckErrors();bool Load( const std::string fileName, SDL_Surface* s, int maxscalex = 1, int maxscaley = 1 );void Play();void Rewind();void Stop();void RenderFrame( int frame );std::string GetBanner();SMPEG_Info GetInfo();SMPEGstatus GetStatus();};#endif/////IMPLEMENTATION OF SOME OF THE FUNCTIONSint BB_video_element::BB_update(){std::string video_file("");std::string banner_file("");if(v_playlist && movie){SMPEGstatus status=GetStatus();if(!m_bInit){if(movie)Play();m_bInit=true;}else if(status==SMPEG_STOPPED){printf("Video finished playing. Getting next video...\n");SMPEG_stop(movie);video_file=v_playlist-&gt;BB_get_next_video();banner_file=v_playlist-&gt;BB_get_banner();//printf("Banner image: %s\n", banner_file.c_str());SDL_FillRect(banner-&gt;BB_get_content() , NULL , 0 );if(strcmp(banner_file.c_str() ,"none")!=0){banner-&gt;BB_set_image(banner_file);banner-&gt;BB_update();}if(Load(video_file, SDL_GetVideoSurface(),1,1))Play();elsereturn 0;}else if(status){banner_file=v_playlist-&gt;BB_get_banner();banner-&gt;BB_set_image(banner_file);banner-&gt;BB_update();//BB_apply_surface(NULL, BB_Content,SDL_GetVideoSurface());}return 1;}elsereturn 0;}bool BB_video_element::Load( const std::string fileName, SDL_Surface* s, int maxscalex, int maxscaley){printf("*Attempting to load a new video %s\n", fileName.c_str());Uint32 rmask, gmask, bmask, amask;#if SDL_BYTEORDER == SDL_BIG_ENDIANrmask = 0xff000000;gmask = 0x00ff0000;bmask = 0x0000ff00;amask = 0x000000ff;#elsermask = 0x000000ff;gmask = 0x0000ff00;bmask = 0x00ff0000;amask = 0xff000000;#endifSDL_Surface *sTemp;sTemp = SDL_CreateRGBSurface(SDL_HWSURFACE, this-&gt;BB_get_w(), this-&gt;BB_get_h(), 32, rmask, gmask, bmask, amask);BB_Content=SDL_DisplayFormat(sTemp);SDL_FreeSurface(sTemp);if(movie){SMPEG_delete(movie);movie=NULL;}movie = SMPEG_new( fileName.c_str(), &movieInfo, true );#ifdef _DEBUGCheckErrors();#endifif(!movie)return false;SMPEG_setdisplay(movie, BB_Content, NULL, updateMPEGFrame);#ifdef _DEBUGCheckErrors();#endifreturn true;}void BB_video_element::updateMPEGFrame(SDL_Surface *buffer, Sint32 x, Sint32 y,Uint32 w, Uint32 h){SDL_BlitSurface(buffer, NULL, SDL_GetVideoSurface(), NULL);  SDL_Flip(SDL_GetVideoSurface());}int BB_video_element::BB_element_init(){if(v_playlist){v_playlist-&gt;BB_generate_playlist();printf("Initialising video\n");while(!Load(v_playlist-&gt;BB_get_next_video(), SDL_GetVideoSurface(),1,1)){}}banner-&gt;BB_set_x(BB_get_x());banner-&gt;BB_set_y(BB_get_y()+BB_get_h()+10);banner-&gt;BB_set_w(BB_get_w());banner-&gt;BB_set_h(50); return 1;}In the main loop i call an update function that goes through a vector of BB_element* and calls the update function... I use to call SDL_Flip in there but the video playback was poor so instead it's called in the callback function for SMPEG...Also FRAME_PERIOD=0.033voidBB_base::BB_update(){if(((Timer-&gt;get_ticks() - this-&gt;c_time)/1000.0f)&gt;SWITCH_PERIOD){if(lang==francais){lang=anglais;}else if(lang==anglais){lang=francais;}//else//lang=DEFAULT_LANGUAGE;for(unsigned int i=0; i&lt;v_element.size(); i++){ v_element-&gt;BB_set_lang(lang);}this-&gt;c_time=Timer-&gt;get_ticks();} //clear the screenif((Timer-&gt;get_ticks()-frame_begin_time)&gt;FRAME_PERIOD){frame_begin_time=Timer-&gt;get_ticks();//SDL_FillRect(BB_Screen , NULL , 0 );for(unsigned int i=0; i&lt;v_element.size(); i++){ v_element-&gt;BB_update();}//SDL_Flip( BB_Screen );}   }I'm calling SDL_Flip in updateMPEGFrame because otherwise i get dropped frames with the video...I also scale the video by passing width and height when creating sTemp with SDL_CreateRGBSurface... but shouldn't I use the scaling function from SMPEG???sTemp = SDL_CreateRGBSurface(SDL_HWSURFACE, this->BB_get_w(), this->BB_get_h(), 32, rmask, gmask, bmask, amask);Any corrections comments or suggestions are very appreciated!If you have any questions, please don't hesitate!Thanks!!![Edited by - Cosmo2 on December 8, 2006 11:45:26 AM]
  First, use the source tags instead of the code tags.Second, try changing everything to software surfaces instead of hardware surfaces. Hardware surfaces are rarely supported and more trouble than they are worth.Also, after you get your video surface, it's always a good idea to convert it to the screen format using SDL_DisplayFormat before you blit, so SDL doesn't have to do that itself all the time.I have no idea how SMPEG works,but are you creating a buffer ahead of time, or trying to process it one frame at a time?   ;Quote:Original post by KaptainKomunistFirst, use the source tags instead of the code tags.Ok done :)Quote:Also, after you get your video surface, it's always a good idea to convert it to the screen format using SDL_DisplayFormat before you blit, so SDL doesn't have to do that itself all the time.Isn't that what I'm doing here in the Load function?SDL_Surface *sTemp;sTemp = SDL_CreateRGBSurface(SDL_HWSURFACE, this-&gt;BB_get_w(), this-&gt;BB_get_h(), 32, rmask, gmask, bmask, amask);BB_Content=SDL_DisplayFormat(sTemp);Quote:I have no idea how SMPEG works,but are you creating a buffer ahead of time, or trying to process it one frame at a time?SMPEG runf in a separate thread and blits to the main surface... i<m not trying to process one frame at a time, I just want the video to play wihtout droping any frames.Thanks!;  Make everything software instead of hardware though? did that change anything?   ;  OK so i switched to SWSURFACE but it didn<t chanfe thing and I keep getting this message:Xlib: unexpected async reply (sequence 0x10)I think part of the problem has to do with when I call the SDlL_Blit function and at what. If I blit in the main loop, it makes more sense in terms of design. But to get some decent results I need to call it from the callback function for SMPE....HELP!! I need to figure this thing out by the end of the week !!!P.S.: Thanks to KatpainKomunist, the help is very appreciated!   ;  You could always look at the source code of sdlBasic and see how Vroby did it.  Having semi-mature open-source code is always helpful.   ;  Hi again,Ok so I had a look at sdlBasic... I did pretty much the same thing. But I think the the issue is that I need to show IMAGES AND VIDEO AT THE SAME TIME.I wrote a small program using the classes I use in myself to illustrate the problem.HERE IS THE MAIN FILE#include <iostream>#include <stdlib.h>#include <vector>//SDL STUFF#include <SDL/SDL.h>#include <SDL/SDL_thread.h>#include <SDL/SDL_mutex.h>#include "BB_element.h"#include "BB_image_element.h"#include "BB_video_element.h"#define S_WIDTH 800#define S_HEIGHT 600SDL_Surface* BB_Screen;int init_screen(){if( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) <0 ){printf("Unable to init SDL: %s\n", SDL_GetError());return 0;}//init SDL_ttfconst SDL_VideoInfo *video_info;Uint32 video_flags;int video_bpp;video_info = SDL_GetVideoInfo();if(video_info->hw_available==1)printf("SDL: Hardware surfaces are supported\n");switch (video_info->vfmt->BitsPerPixel) {case 16:case 32:video_bpp = video_info->vfmt->BitsPerPixel;break;default:video_bpp = 16;break;}video_flags = SDL_SWSURFACE| SDL_DOUBLEBUF;BB_Screen=SDL_SetVideoMode(S_WIDTH, S_HEIGHT, video_bpp,video_flags);if (BB_Screen == NULL) {fprintf(stderr, "Unable to set up video: %s\n", SDL_GetError());return 0;}SDL_WM_SetCaption("Video playback test", NULL );atexit(SDL_Quit);return 1; }//using namespace std;int main(int argc, char *argv[]){std::vector<BB_element*> v_element;if(init_screen()){BB_element* temp;temp= new BB_image_element("test.jpg");v_element.push_back(temp); temp= new BB_video_element("test1.mpg"); v_element.push_back(temp);std::vector<BB_element*>::iterator it_Element;for(it_Element=v_element.begin();it_Element<v_element.end(); it_Element++){if(*it_Element){(*it_Element)->BB_element_init();}}while(1){for(it_Element=v_element.begin();it_Element<v_element.end(); it_Element++){if(*it_Element){if((*it_Element)->BB_update()==0)exit(2);}}SDL_Flip(BB_Screen);}}else{SDL_Quit();}  }THIS IS THE BASE CLASS CALLED BB_ELEMENT: IT ESSENTIALY IS USED TO STORE POSITION AND DIMENSION PARAMETERSHEADER/*************************************************************************** *   Copyright (C) 2006 by Cosmo Kramer   * *   Cosmo@localhost.localdomain   * *   * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or* *   (at your option) any later version.* *   * *   This program is distributed in the hope that it will be useful,  * *   but WITHOUT ANY WARRANTY; without even the implied warranty of   * *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    * *   GNU General Public License for more details. * *   * *   You should have received a copy of the GNU General Public License* *   along with this program; if not, write to the* *   Free Software Foundation, Inc.,    * *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.   * ***************************************************************************///////////////////////////////////////////////////////////////////////////*BACKBONE PROJECTAUTHOR: ALEXANDRE SIMIONESCUALEXANDRE SIMIONESCU 2006 COPYRIGHT *//////////////////////////////////////////////////////////////////////////#ifndef BB_ELEMENT_H#define BB_ELEMENT_H#include "SDL_image.h"#include <string>#ifndef NULL#define NULL 0#endifclass BB_element{protected:int alpha;SDL_Surface *BB_Content;SDL_Rect Offset;SDL_Rect Clip;public:virtual ~BB_element(){  printf("Base class destructor\n");};BB_element(){Offset.x=10;Offset.y=10;Offset.h=400;Offset.w=400;Clip.h=0;Clip.w=0;Clip.x=0;Clip.y=0;BB_Content=NULL;}virtual int BB_update()=0;virtual int BB_element_init()=0;virtual void BB_pause(){};//getint BB_get_x()const{return Offset.x;}int BB_get_y()const{return Offset.y;}int BB_get_w()const{return Offset.w;}int BB_get_h()const{return Offset.h;}SDL_Surface* BB_get_content() const {return BB_Content;}//setvoid BB_set_x(int n_x){Offset.x=n_x;}void BB_set_y(int n_y){Offset.y=n_y;}void BB_set_w(int n_w){Offset.w=n_w;}void BB_set_h(int n_h){Offset.h=n_h;}//void BB_apply_surface(SDL_Rect* Pos,SDL_Surface* source, SDL_Surface* destination );};#endifSOURCE/*************************************************************************** *   Copyright (C) 2006 by Cosmo Kramer   * *   Cosmo@localhost.localdomain   * *   * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or* *   (at your option) any later version.* *   * *   This program is distributed in the hope that it will be useful,  * *   but WITHOUT ANY WARRANTY; without even the implied warranty of   * *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    * *   GNU General Public License for more details. * *   * *   You should have received a copy of the GNU General Public License* *   along with this program; if not, write to the* *   Free Software Foundation, Inc.,    * *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.   * ***************************************************************************///libraires SDL#include "SDL_image.h"#include "SDL_ttf.h"#include "BB_element.h"intBB_element::BB_element_init(){return 1;}// voidBB_element::BB_apply_surface(SDL_Rect* Pos,SDL_Surface* source, SDL_Surface* destination ){//    // SDL_SetAlpha(source, SDL_SRCALPHA, alpha);// //VERIFIER S'IL FAUT FAIRE UN CLIPPING// if(Clip.w!=0&&Clip.h!=0){// SDL_SetClipRect(destination, &Clip);// }// else// SDL_SetClipRect(destination, NULL);// if (SDL_MUSTLOCK(SDL_GetVideoSurface()))// SDL_LockSurface(SDL_GetVideoSurface());// if(Pos==NULL)// SDL_BlitSurface( source, NULL, destination, &Offset );// else// SDL_BlitSurface( source, NULL, destination, Pos );// // // if (SDL_MUSTLOCK(SDL_GetVideoSurface()))// SDL_UnlockSurface(SDL_GetVideoSurface());// // // }intBB_element::BB_update(){return 1;}THIS IS THE BB_IMAGE_ELEMENT CLASS TO SHOW IMAGES HEADER#ifndef BB_IMAGE_ELEMENT_H#define BB_IMAGE_ELEMENT_H#include "BB_element.h"#include <string>class BB_image_element: public BB_element{private:std::string img_src;public:~BB_image_element();BB_image_element();BB_image_element(std::string image_src){img_src=image_src;}SDL_Surface* BB_optimize_image(char* fname);int BB_element_init();void BB_set_image(std::string src);int BB_update();};#endifSOURCE#include "BB_image_element.h"BB_image_element::~BB_image_element(){printf("Deleted image_element\n");}BB_image_element::BB_image_element(){}int BB_image_element::BB_element_init(){if(img_src.length()==0)return 0;//NEWBB_Content=BB_optimize_image((char*)img_src.c_str());if(BB_Content!=NULL){//SDL_BlitSurface( BB_Content, &temp, SDL_GetVideoSurface(), &temp );return 1;}elsereturn 0;}void BB_image_element::BB_set_image(std::string src){img_src=src;}int BB_image_element::BB_update(){if(BB_Content==NULL){printf("ERROR LOADING OPTIMIZED IMAGE\n");return  0;}SDL_BlitSurface( BB_Content,NULL, SDL_GetVideoSurface(), &Offset ); return 1;}SDL_Surface*BB_image_element::BB_optimize_image(char* fname){SDL_Surface* loadedImage = NULL; SDL_Surface* optimizedImage = NULL; loadedImage = IMG_Load( fname ); if( loadedImage != NULL ) { optimizedImage = SDL_DisplayFormat( loadedImage ); SDL_FreeSurface( loadedImage );}elseprintf("ERROR LOADING IMAGE:-- %s --\n",fname);return optimizedImage;}THIS IS THE BB_VIDEO_ELEMENT CLASS TO SHOW VIDEOSHEADER#ifndef BB_VIDEO_ELEMENT_H#define BB_VIDEO_ELEMENT_H//SMPEG#include "smpeg.h"#include "BB_element.h"  class BB_video_element:public BB_element{private:SMPEG_Info movieInfo;std::string v_file;SMPEG *movie;bool m_bInit;public://fix :: pas mettre la playlist public~BB_video_element();BB_video_element();BB_video_element(std::string v_name);int BB_element_init();int BB_update();static void updateFrame(SDL_Surface *buffer, Sint32 x, Sint32 y,Uint32 w, Uint32 h);void BB_pause();void CheckErrors();bool Load( const std::string fileName);void Play();void Stop();SMPEG_Info GetInfo();SMPEGstatus GetStatus();};#endifSOURCE#include "BB_video_element.h"BB_video_element::~BB_video_element(){printf("DESTRUCTOR::BB_movie_element\n");if(movie){SMPEG_stop(movie);SMPEG_delete( movie );movie=NULL;}SDL_FreeSurface(BB_Content);}BB_video_element::BB_video_element():movie(NULL), m_bInit(false){BB_Content=NULL;}BB_video_element::BB_video_element(std::string v_name):movie(NULL), m_bInit(false){v_file=v_name;BB_Content=NULL;}void BB_video_element::CheckErrors(){char* error = SMPEG_error( movie );if( error )printf( "Video Error: %s\n", error );}void BB_video_element::Play(){//SMPEG_setdisplay(movie,BB_Content, NULL, updateFrame);SMPEG_setdisplay(movie,SDL_GetVideoSurface(), NULL, updateFrame);SMPEG_scaleXY(movie, BB_get_w(), BB_get_h());SMPEG_move(movie, BB_get_x(), BB_get_y());SMPEG_play(movie);CheckErrors();}void BB_video_element::Stop(){SMPEGstatus status=GetStatus();if(status==SMPEG_PLAYING){SMPEG_stop( movie );CheckErrors();}}SMPEG_Info BB_video_element::GetInfo(){SMPEG_getinfo( movie, &movieInfo );return movieInfo;}SMPEGstatus BB_video_element::GetStatus(){return SMPEG_status(movie);}int BB_video_element::BB_update(){if(movie){if(!m_bInit){Play();m_bInit=true;return 1;}GetInfo();if(GetStatus()==SMPEG_STOPPED)return 0;}elsereturn 0;}bool BB_video_element::Load( const std::string fileName){int use_video=1;int mpeg_audio= 1;SMPEG_Filter *filter;movie = SMPEG_new(fileName.c_str(), &movieInfo, mpeg_audio);if ( SMPEG_error(movie) ) {fprintf(stderr, "%s: %s\n", fileName.c_str(), SMPEG_error(movie));SMPEG_delete(movie);exit(2);}SMPEG_enableaudio(movie, mpeg_audio);SMPEG_enablevideo(movie, use_video);SMPEG_setvolume(movie, 100);filter = SMPEGfilter_bilinear();filter = SMPEG_filter( movie, filter );filter->destroy(filter);return true;}void BB_video_element::updateFrame(SDL_Surface *screen  /* *buffer */, Sint32 x, Sint32 y,Uint32 w, Uint32 h){    if ( screen->flags & SDL_DOUBLEBUF ) {  //SDL_BlitSurface(screen, NULL, SDL_GetVideoSurface(), NULL);SDL_Flip(SDL_GetVideoSurface());    }}int BB_video_element::BB_element_init(){Uint32 rmask, gmask, bmask, amask;#if SDL_BYTEORDER == SDL_BIG_ENDIANrmask = 0xff000000;gmask = 0x00ff0000;bmask = 0x0000ff00;amask = 0x000000ff;#elsermask = 0x000000ff;gmask = 0x0000ff00;bmask = 0x00ff0000;amask = 0xff000000;#endifSMPEG_Filter *filter;SDL_Surface *sTemp; sTemp = SDL_CreateRGBSurface(SDL_SWSURFACE, this->BB_get_w(), this->BB_get_h(), 32, rmask, gmask, bmask, amask);//sTemp = SDL_CreateRGBSurface(SDL_GetVideoSurface()->flags, SDL_GetVideoSurface()->w, SDL_GetVideoSurface()->h, 32, SDL_GetVideoSurface()->format->Rmask, SDL_GetVideoSurface()->format->Gmask,SDL_GetVideoSurface()->format->Bmask, SDL_GetVideoSurface()->format->Amask);BB_Content=SDL_DisplayFormat(sTemp);SDL_FreeSurface(sTemp);Load(v_file);return 1;}void BB_video_element::BB_pause(){if(movie){SMPEG_stop(movie);}}THIS IS THE MAKEFILEbin_PROGRAMS = video_testvideo_test_SOURCES = video_test.cpp BB_element.cpp BB_image_element.cpp BB_video_element.cpp# set the include path found by configureAM_CPPFLAGS =  $(LIBSDL_CFLAGS) $(all_includes)# the library search path.video_test_LDFLAGS = $(all_libraries) $(LIBSDL_RPATH)video_test_LDADD = $(LIBSDL_LIBS)noinst_HEADERS = BB_element.h BB_image_element.h BB_video_element.hINCLUDES = -I/usr/include/smpegWith this code I still get:Xlib: unexpected async reply...I need to finish this thing soon, so any help is appreciated!!!Thanks!!   