Commits

zeroth  committed f9e4dd4

Compilation works, just need to get linking to work.

  • Participants
  • Parent commits 1aee118
  • Branches tylerthemovie

Comments (0)

Files changed (2)

File src/ff_movie.c

                         /*if (pvs->out_surf->flags & SDL_OPENGL && !(pvs->out_surf->flags & (SDL_OPENGLBLIT & ~SDL_OPENGL)))
                                 return RAISE (PyExc_SDLError,
                                               "Cannot blit to OPENGL Surfaces (OPENGLBLIT is ok)");*/
+                        //TODO:fix blitting to surface, and blend_subrect
+                        #if 0
                         SDL_LockSurface(pvs->out_surf);
-                        pict.data[0] = pvs->out_surf->pixels[0];
+                        pict.data[0] = (Uint8 *)pvs->out_surf->pixels[0];
                         pict.data[1] = pvs->out_surf->pixels[1];
                         pict.data[2] = pvs->out_surf->pixels[2];
 
                                           pvs->out_surf->w, pvs->out_surf->h);
                                               
                         SDL_UnlockSurface(pvs->out_surf);
+                        #endif
                     }
                 }
             }
         }
         else
         {
+            //TODO:fix this as well
+            #if 0
             dst_pix_fmt = PIX_FMT_RGB24;
               
             SDL_LockSurface (pvs->out_surf);
                       0, pvs->video_st->codec->height, pict.data, pict.linesize);
             /* update the bitmap content */
             SDL_UnlockSurface(pvs->out_surf);
+            #endif
         }
         
         vp->pts = pts;
     err = av_open_input_file(&ic, is->filename, is->iformat, 0, ap);
     if (err < 0) {
         //TODO:Python exception here please
-        print_error(is->filename, err);
+        PyErr_Format(PyExc_IOError, "There was a problem opening up %s", is->filename);
+        //print_error(is->filename, err);
         ret = -1;
         goto fail;
     }
             av_init_packet(pkt);
             pkt->data=NULL;
             pkt->size=0;
-            pkt->stream_index= pvs->video_stream;
+            pkt->stream_index= is->vid_stream_ix;
             packet_queue_put(&pvs->videoq, pkt);
             Py_XDECREF((PyObject *) pas);
             Py_XDECREF((PyObject *) pvs);
 
 /* Python C-API stuff */
 
-static PyMethodDef
-Movie_methods[] = {
+static PyMethodDef _movie_methods[] = {
    { "play",    (PyCFunction) _movie_play, METH_VARARGS,
                "Play the movie file from current time-mark. If loop<0, then it will loop infinitely. If there is no loop value, then it will play once." },
    { "stop", (PyCFunction) _movie_stop, METH_NOARGS,
     0,                          /* tp_weaklistoffset */
     0,                          /* tp_iter */
     0,                          /* tp_iternext */
-    *Movie_methods,             /* tp_methods */
+    _movie_methods,             /* tp_methods */
     0,                          /* tp_members */
     _movie_getsets,             /* tp_getset */
     0,                          /* tp_base */
     0,                          /* tp_dictoffset */
     0,                          /* tp_init */
     0,                          /* tp_alloc */
-    _movie_new,                 /* tp_new */
+    (newfunc )_movie_new,                 /* tp_new */
     0,                          /* tp_free */
     0,                          /* tp_is_gc */
     0,                          /* tp_bases */
         surf = PySurface_AsSurface(surface);
         movie->out_surf=surf;
         movie->overlay=1;
-    
+    }
     else
     {
         movie->overlay=0;
     
 static PyObject* _movie_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-    PyObject *obj, obj2;
+    PyObject *obj;
+    PyObject *obj2;
     if (!PyArg_ParseTuple (args, "sO|s", &obj, &obj2))
         Py_RETURN_NONE;
     if(!PyString_Check(obj))
         PyErr_SetString(PyExc_TypeError, "Could not find a filename.");
         Py_RETURN_NONE;
     }
-    return _movie_new_internal(type, obj, obj2);
+    return _movie_new_internal(type, &obj, &obj2);
     
 }
 
 
 static PyObject* _movie_get_paused (PyMovie *movie, void *closure)
 {
-    return PyInt_FromInt(movie->paused);
+    return PyInt_FromLong((long)movie->paused);
 }
 static PyObject* _movie_get_playing (PyMovie *movie, void *closure)
 {
     PyObject *pyo;
-    pyo= PyInt_FromInt(movie->playing);
+    pyo= PyInt_FromLong((long)movie->playing);
     return pyo;
 }
 

File src/ff_movie.h

 
 #include <libavutil/avstring.h>
 
-#include <ffmpeg/swscale.h>
+#include <libswscale/swscale.h>
 
 #include <libavdevice/avdevice.h>
 
 #include <SDL_thread.h>
 #include <libavformat/avformat.h>
 #include <libavcodec/avcodec.h>
+#include <libavutil/avutil.h>
 
 
 #define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
 
 #define BPP 1
 
+#define __GNUC__
+#if defined(__ICC) || defined(__SUNPRO_C)
+    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
+    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
+#elif defined(__GNUC__)
+    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v attribute_used __attribute__ ((aligned (n)))
+#elif defined(_MSC_VER)
+    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
+    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
+#elif HAVE_INLINE_ASM
+    #error The asm code needs alignment, but we do not know how to do it for this compiler.
+#else
+    #define DECLARE_ALIGNED(n,t,v)      t v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v
+#endif
+
 static int sws_flags = SWS_BICUBIC;
 
-
-
 //packet queue, as per ffplay, to hold packets for audio/video/subtitle streams. 
 typedef struct PacketQueue {
     AVPacketList *first_pkt, *last_pkt;
     AVPacket audio_pkt;
     uint8_t *audio_pkt_data;
     int audio_pkt_size;
-    enum SampleFormat *audio_src_fmt;
+    enum SampleFormat audio_src_fmt;
     AVAudioConvert *reformat_ctx;
 
     /*time-keeping values