openframeworks/openFrameworks — pull request #2572 by kroko (2013-09-18 23:51:23+00:00)
Title: Dynamic movie resize for RTSP streams which always start up as 160x120px

RTSP streams always start up as 160x120px. Such size is rarely the case.

Added a quick way for handling that
```cpp
loadMovie(string path, ofQTKitDecodeMode mode, bool expectResize = false)
```
i.e.
```cpp
loadMovie("rtsp://127.0.0.1/mystream.sdp", OF_QTKIT_DECODE_PIXELS_AND_TEXTURE, true);
```
will start drawing immediately, but also wait for resize to happen (code only waits for one resize).
the texture in ofKitPlayer will resize automatically
pixels in ofKitPlayer are reallocated upon resize
all movie size getters will return new size

added also getResizeHappened() method, so that user could avoid drawing before the resize has happened

testcode:
```cpp
#pragma once

#include "ofMain.h"

class testApp : public ofBaseApp{
public:

//////////////////////////////////////////////////////////
// CONSTUCT AND DECONSTRUCT
void setup();
void exit();

//////////////////////////////////////////////////////////
// LOOP
void update();
void draw();

ofQTKitPlayer qtKitPlayer;
ofTexture * qtKitPlayerCurrTexture;

};

#include "testApp.h"

//--------------------------------------------------------------
void testApp::setup(){

ofSetVerticalSync(true);
ofSetFrameRate(60);
ofSetCircleResolution(50);
ofEnableSmoothing();
ofBackground(255,255,255);
ofSetBackgroundAuto(true);

qtKitPlayer.loadMovie("rtsp://127.0.0.1/mystream.sdp", OF_QTKIT_DECODE_PIXELS_AND_TEXTURE, true);
qtKitPlayer.play();
qtKitPlayerCurrTexture = NULL;
}

//--------------------------------------------------------------
void testApp::exit(){

}

//--------------------------------------------------------------
void testApp::update(){
qtKitPlayer.update();
if(qtKitPlayer.isFrameNew()) {
qtKitPlayerCurrTexture = qtKitPlayer.getTexture();
}
if(qtKitPlayer.isFrameNew()) {
unsigned char * qtKitPlayerCurrPix = qtKitPlayer.getPixels();
}
}

//--------------------------------------------------------------
void testApp::draw(){
qtKitPlayer.draw(10, 10);
if(qtKitPlayerCurrTexture) {
qtKitPlayerCurrTexture->draw(10,260);
}
}

```