Création du message
01-08-2010 21:10:36
nico
ouai je vais essayer d'améliorer les onglets,
sinon je vous conseil d'utiliser firefox, puisqu'il mémorise les scroll quand on navigue entre les pages, perso je préfère chrome mais pour le coup c'est pas pratique, je pourrai faire un truc en javascript pour mémoriser les scroll mais ça serait trop lourd comme code, donc voilà c bon à savoir
ideview(++);
gfgjfj
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
#ifndef _SVIDEO_H_
#define _SVIDEO_H_
/** * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* created by Ovan or Magun *
* compile with : lavformat,lavcodec,lavutil *
* and other library defined last *
* *
* conctact me : *
* www.irrlicht.fr *
* www.immortal-galaxy.com *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * **/
#include <stdint.h>
#if defined WIN32 || defined WIN64 || defined _WIN32_ || defined _WIN64_
#define WINDOWS
#endif
struct AVFormatContext;
struct AVCodecContext;
struct AVCodec;
struct AVPicture;
struct AVFrame;
namespace interne
{
namespace _interface { class CGUIVideo; }
struct SVideo
{
public :
SVideo();
SVideo(char*file,bool sound = false);
~SVideo();
bool open( char *file, bool sound);
void play( bool p = true ), stop(), setLoop(bool b = false);
bool restart(), isPlay(), isLoop();
int getWindowFPS(), getVideoFPS();
double getOriginalFPS(); //! get video file fps info
int getFrame(), getTotalFrame();
int getTime(), getTotalTime();//!
void goToFrame(int frm);
void goToTime(int sec = 0, int min = 0, int h = 0);
//! file info ... update ffmpeg for use this
char *getAuthor(), *getAlbum();
char *getTitle(), *getCopyright();
char *getComment(), *getGenre();
int getYear(), getTrack();
bool makeFrame();
signed int width, height;
private :
friend class _interface::CGUIVideo;
char *file;
AVFrame *Frame,*FrameRGB;
AVFormatContext *FormatCtx;
AVCodecContext *videoCodecCtx ,*audioCodecCtx ,*dataCodecCtx;
AVCodec *videoCodec ,*audioCodec ,*dataCodec;
uint8_t *buffer;
double videoFPS;
int nFrm, frame, numBytes, windowFPS;
int videoStream, audioStream, dataStream;
bool drawFrame, Sound, Play, Replay, writeConsol;
};
}
#endif
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
#include "CGUIVideo.h"
using namespace std;
#if defined WIN32 || defined WIN64 || defined _WIN32_ || defined _WIN64_
extern "C"
{
#include <ffmpeg/avcodec.h>
}
#else
extern "C"
{
#include <libavcodec/avcodec.h>
}
#endif
/** * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* created by Ovan or Magun *
* compile with : lavformat,lavcodec,lavutil *
* and other library defined last *
* *
* conctact me : *
* www.irrlicht.fr *
* www.immortal-galaxy.com *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * **/
namespace interne
{
namespace _interface
{
CGUIVideo::CGUIVideo( SVideo *d, bool run, bool loop )
{
data = d;
data->Play = data->Replay = writeConsol = data->drawFrame = false;
#if defined SDL_SUPPORT
bmp = false;
#elif defined IRRLICHT_SUPPORT
VTexture = false;
VImage = false;
#endif
data->Play = run;
data->Replay = loop;
writeConsol = data->writeConsol = false;
lastTime = 0;
}
CGUIVideo::~CGUIVideo(){ }
void CGUIVideo::setConsole(bool b){ data->writeConsol = writeConsol = b; }
/********** VIDEO VIEW *********/
void CGUIVideo::setFPS(double fps) { data->videoFPS = fps; }
bool CGUIVideo::creatFrameScreenshot(char *name){}
void CGUIVideo::WindowFPS()
{
#if defined SDL_SUPPORT
static int time, frame,i;
i+=1;
if(SDL_GetTicks() - time > 1000)
{
windowFPS = i - frame;
frame = i;
time = SDL_GetTicks();
}
#elif defined IRRLICHT_SUPPORT
data->windowFPS = driver->getFPS();
#elif SFML_SUPPORT
static double time, frame,i;
i+=1;
if(timer.GetElapsedTime() - time)
{
windowFPS = i - frame;
frame = i;
time = timer.GetElapsedTime();
}
#endif
}
bool CGUIVideo::refreshByTime()
{
bool rf;
if(data->Play
#if defined SDL_SUPPORT
&& SDL_GetTicks() - lastTime > videoFPS*1000
#elif defined SFML_SUPPORT
&& timer.GetElapsedTime() > videoFPS
#elif defined IRRLICHT_SUPPORT
&& Timer->getRealTime() - lastTime > data->videoFPS*1000
#endif
)
{
#if defined SDL_SUPPORT
lastTime = SDL_GetTicks();
#elif defined SFML_SUPPORT
timer.Reset();
#elif defined IRRLICHT_SUPPORT
lastTime = Timer->getRealTime();
#endif
return refresh();
}
}
bool CGUIVideo::refreshByFPS()
{
WindowFPS();
static int i = (int)(data->getTotalFrame() / data->videoFPS), io = 0;
io = io+i;
data->goToFrame((int)io);
}
bool CGUIVideo::refresh() { return data->makeFrame(); }
#if defined SDL_SUPPORT
bool CGUIVideo::draw(SDL_Surface *screen, SDL_Rect rect)
{
WindowFPS();
if(Play && frame)
{
if(!bmp)
bmp = SDL_CreateYUVOverlay(data->width,data->height, SDL_YV12_OVERLAY,screen);
SDL_LockYUVOverlay(bmp);
pict.data[0] = bmp->pixels[0];
pict.data[1] = bmp->pixels[2];
pict.data[2] = bmp->pixels[1];
pict.linesize[0] = bmp->pitches[0];
pict.linesize[1] = bmp->pitches[2];
pict.linesize[2] = bmp->pitches[1];
img_convert(&pict, PIX_FMT_YUVJ420P,(AVPicture *)Frame,videoCodecCtx->pix_fmt,width,height);
SDL_UnlockYUVOverlay(bmp);
SDL_DisplayYUVOverlay(bmp, &rect);
}
}
#elif defined IRRLICHT_SUPPORT
irr::video::IImage* CGUIVideo::getImage() { return VImage; }
irr::video::ITexture* CGUIVideo::getTexture() { return VTexture; }
void CGUIVideo::setVideoDriver(irr::video::IVideoDriver*drive,irr::ITimer *time)
{
driver = drive; Timer = time;
}
irr::video::ITexture* CGUIVideo::draw()
{
WindowFPS();//temporaire, wait to dev syncronisation video
if(data->Play && data->frame && data->drawFrame)
{
if(!VImage) VImage = driver->createImageFromData(irr::video::ECF_A1R5G5B5,irr::core::dimension2d<irr::u32>(data->width,data->height),data->FrameRGB->data[0],true);
if(!VTexture) VTexture = driver->addTexture("Movie", VImage);
irr::u32 *tBits = (irr::u32*)VTexture->lock();
for(irr::u32 j=0; j<data->height; ++j)
for(irr::u32 i=0; i<data->width; ++i)
tBits[j*data->width+i] = VImage->getPixel(i,j).color;
VTexture->unlock();
data->drawFrame = false;
return VTexture;
}
}
#endif
}
}
Si vous ne pouvez pas activer javacsript, clique ici