comparison MediaPlayer.cpp @ 2319:9987f93d7e1f

stuff.h
author Ritor1
date Thu, 20 Mar 2014 18:44:27 +0600
parents 58be29479e75
children 182effc4b0ee
comparison
equal deleted inserted replaced
2318:133882370e83 2319:9987f93d7e1f
5 #include "lib/libavutil/avutil.h" 5 #include "lib/libavutil/avutil.h"
6 #include "lib/libavutil/imgutils.h" 6 #include "lib/libavutil/imgutils.h"
7 #include "lib/libswscale/swscale.h" 7 #include "lib/libswscale/swscale.h"
8 #include "lib/libswresample/swresample.h" 8 #include "lib/libswresample/swresample.h"
9 #include "lib/libavutil/opt.h" 9 #include "lib/libavutil/opt.h"
10 //#include "libavutil/samplefmt.h"
11 } 10 }
12 #pragma comment(lib, "avcodec.lib") 11 #pragma comment(lib, "avcodec.lib")
13 #pragma comment(lib, "avformat.lib") 12 #pragma comment(lib, "avformat.lib")
14 #pragma comment(lib, "avutil.lib") 13 #pragma comment(lib, "avutil.lib")
15 #pragma comment(lib, "swscale.lib") 14 #pragma comment(lib, "swscale.lib")
21 #include "stuff.h" 20 #include "stuff.h"
22 #include "OpenALSoundProvider.h" 21 #include "OpenALSoundProvider.h"
23 22
24 #include "MediaPlayer.h" 23 #include "MediaPlayer.h"
25 using namespace Media; 24 using namespace Media;
26
27
28 25
29 26
30 class MemoryStream 27 class MemoryStream
31 { 28 {
32 public: 29 public:
660 657
661 virtual void Play() 658 virtual void Play()
662 { 659 {
663 } 660 }
664 661
665 virtual void GetNextFrame(double dt, void *dst_surface) 662 virtual void GetNextFrame(double dt, void *dst_surface)// рисует сразу на экран
666 { 663 {
667 playback_time += dt; 664 playback_time += dt;//изменение времени
668 665
669 AVPacket *avpacket = decoding_packet; 666 AVPacket *avpacket = decoding_packet;
670 AVFrame *avframe = decoding_frame; 667 AVFrame *avframe = decoding_frame;
671 avcodec_get_frame_defaults(avframe); 668 avcodec_get_frame_defaults(avframe);
672 669
678 } 675 }
679 676
680 volatile int decoded = false; 677 volatile int decoded = false;
681 do 678 do
682 { 679 {
683 if (av_read_frame(format_ctx, avpacket) < 0) 680 if (av_read_frame(format_ctx, avpacket) < 0) //воспроизведение завершено
684 { 681 {
685 // probably movie is finished 682 // probably movie is finished
686 __debugbreak(); 683 __debugbreak();
687 } 684 }
688 685