summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/util/render/pictureArray.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /mpeglib/lib/util/render/pictureArray.cpp
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'mpeglib/lib/util/render/pictureArray.cpp')
-rw-r--r--mpeglib/lib/util/render/pictureArray.cpp101
1 files changed, 101 insertions, 0 deletions
diff --git a/mpeglib/lib/util/render/pictureArray.cpp b/mpeglib/lib/util/render/pictureArray.cpp
new file mode 100644
index 00000000..71381ea0
--- /dev/null
+++ b/mpeglib/lib/util/render/pictureArray.cpp
@@ -0,0 +1,101 @@
+/*
+ nice try of an X11 output plugin
+ Copyright (C) 1999 Martin Vogt
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Library General Public License as published by
+ the Free Software Foundation.
+
+ For more information look at the file COPYRIGHT in this package
+
+ */
+
+
+#include "pictureArray.h"
+
+
+
+PictureArray::PictureArray(int width, int height) {
+ int i;
+ pictureCallback=NULL;
+ imageType=PICTURE_NO_TYPE;
+
+ for (i=0;i<_PICTURE_ARRAY_SIZE;i++) {
+ pictureArray[i]=new YUVPicture(width,height);
+ imageType=pictureArray[i]->getImageType();
+ }
+
+ /* Find a pict image structure in ring buffer not currently locked. */
+ /* Set current pict image structure to the one just found in ring. */
+
+ current=pictureArray[0];
+ past=pictureArray[1];
+ future=pictureArray[2];
+
+ picPerSec=0.0;
+ this->width=width;
+ this->height=height;
+
+}
+
+
+PictureArray::~PictureArray() {
+ int i;
+ for (i=0;i<_PICTURE_ARRAY_SIZE;i++) {
+ if (pictureArray[i] != NULL) {
+ delete pictureArray[i];
+ pictureArray[i]=NULL;
+ }
+
+ }
+}
+
+
+
+
+
+void PictureArray::setPicturePerSecond(double val) {
+ picPerSec=val;
+}
+
+
+double PictureArray::getPicturePerSecond() {
+ return picPerSec;
+}
+
+
+
+
+void PictureArray::forward() {
+ /* Update past and future references if needed. */
+
+ YUVPicture* tmp=past;
+
+ past = future;
+ future = current;
+ current = tmp;
+
+
+}
+
+
+
+
+YUVPicture* PictureArray::getYUVPictureCallback() {
+ return pictureCallback;
+}
+
+
+void PictureArray::setYUVPictureCallback(YUVPicture* pic) {
+ this->pictureCallback=pic;
+}
+
+
+void PictureArray::setImageType(int imageType) {
+ int i;
+ this->imageType=imageType;
+ for (i=0;i<_PICTURE_ARRAY_SIZE;i++) {
+ pictureArray[i]->setImageType(imageType);
+ }
+}
+