Changeset 6127 in orxonox.OLD for branches/avi_play/src/lib/graphics/importer
- Timestamp:
- Dec 15, 2005, 11:54:48 PM (19 years ago)
- Location:
- branches/avi_play/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/lib/graphics/importer/media_container.cc
r6112 r6127 40 40 av_register_all(); 41 41 42 current_frame= 0;42 fps = 0; 43 43 44 44 if (filename != NULL) … … 89 89 if(frame_finished) 90 90 { 91 current_frame++; 92 PRINTF(1)("current_frame: %i\n", current_frame); 93 94 // Convert the image from its native format to RGB 91 PRINTF(1)("frame_number: %i\n", codec_context->frame_number); 92 93 // Convert the image from its native format to RGB 95 94 img_convert((AVPicture*)RGB_frame, PIX_FMT_RGB24, (AVPicture*)frame, codec_context->pix_fmt, 96 95 codec_context->width, codec_context->height); … … 145 144 146 145 // Open file 147 sprintf(filename, "frame%i.ppm", c urrent_frame);146 sprintf(filename, "frame%i.ppm", codec_context->frame_number); 148 147 file = fopen(filename, "wb"); 149 148 if(file == NULL) … … 215 214 avpicture_fill((AVPicture *)RGB_frame, buffer, PIX_FMT_RGB24, codec_context->width, codec_context->height); 216 215 216 // Calculate fps 217 fps = av_q2d(format_context->streams[video_stream]->r_frame_rate); 217 218 } 218 219 … … 227 228 } 228 229 229 int MediaContainer::getCurrentFrame() 230 { 231 return this->current_frame; 232 } 233 234 int MediaContainer::getFrameRate() 235 { 236 237 } 238 239 void MediaContainer::getStream(/* stream */) 240 { 241 230 int MediaContainer::getFrameNumber() 231 { 232 return codec_context->frame_number; 233 } 234 235 double MediaContainer::getFPS() 236 { 237 return this->fps; 242 238 } 243 239 … … 258 254 PRINTF(1)("nb_frames: %i\n", format_context->streams[video_stream]->nb_frames); 259 255 PRINTF(1)("r_frame_rate: %i\n", format_context->streams[video_stream]->r_frame_rate.num); 256 PRINTF(1)("FPS: %f\n", av_q2d(format_context->streams[video_stream]->r_frame_rate)); 260 257 PRINTF(1)("========================\n"); 261 258 PRINTF(1)("= AVCodecContext =\n"); … … 263 260 PRINTF(1)("width: %i\n", codec_context->width); 264 261 PRINTF(1)("height: %i\n", codec_context->height); 262 PRINTF(1)("time_base.den: %i\n", codec_context->time_base.den); 263 PRINTF(1)("time_base.num: %i\n", codec_context->time_base.num); 265 264 PRINTF(1)("========================\n"); 266 265 PRINTF(1)("= AVCodec =\n"); … … 286 285 PRINTF(1)("========================\n"); 287 286 } 287 288 289 //pts = av_q2d(is->video_st->time_base)*pkt->dts; 290 //pkt = packet 291 //avstrream = viedo_st 292 //pts = double -
branches/avi_play/src/lib/graphics/importer/media_container.h
r6112 r6127 29 29 private: 30 30 31 int current_frame; 32 int num_frames; 31 double fps; 33 32 GLuint texture; 34 33 uint8_t* data; … … 57 56 int getHeight(); 58 57 int getWidth(); 59 int getCurrentFrame(); 60 int getFrameRate(); 61 void getStream(/* stream */); 58 int getFrameNumber(); 59 double getFPS(); 62 60 63 61 /* prints some information about the
Note: See TracChangeset
for help on using the changeset viewer.