summaryrefslogtreecommitdiff
path: root/rotord/src
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-09-18 12:44:46 +0100
committerTim Redfern <tim@eclectronics.org>2013-09-18 12:44:46 +0100
commitb57c742e2df5c8f495a3b4dbf4a9e56a4aab9f7e (patch)
tree7a339316d9877254773e0aa650e9a92f65adfb27 /rotord/src
parentef032276fc0e202b8c54dc6239bac418ffdc4c70 (diff)
parente8bfadcde7063ebaac5c8121747109dd574abf61 (diff)
trying avformat_write_header options in exporter
Diffstat (limited to 'rotord/src')
-rw-r--r--rotord/src/libavwrapper.cpp21
-rw-r--r--rotord/src/libavwrapper.h5
-rw-r--r--rotord/src/rendercontext.cpp23
3 files changed, 37 insertions, 12 deletions
diff --git a/rotord/src/libavwrapper.cpp b/rotord/src/libavwrapper.cpp
index d4f35ee..65bbeb5 100644
--- a/rotord/src/libavwrapper.cpp
+++ b/rotord/src/libavwrapper.cpp
@@ -195,11 +195,27 @@ bool libav::exporter::record(std::string filename){
}
}
+<<<<<<< HEAD
AVDictionary *opts = NULL; // "create" an empty dictionary
// Write the stream header, if any. //
int ret = avformat_write_header(oc, &opts);
+=======
+ ///
+ /// trying to change the moov atom 170913
+
+ //MOVMuxContext *mov = oc->priv_data;
+ //mov->flags |= FF_MOV_FLAG_FRAGMENT;
+ //AVDictionary* options;
+ //av_dict_set(&options, "vprofile", "baseline", 0);
+
+ ///
+ ///
+
+ // Write the stream header, if any. //
+ int ret = avformat_write_header(oc, NULL); //&options); //
+>>>>>>> e8bfadcde7063ebaac5c8121747109dd574abf61
if (ret < 0) {
std::cerr <<"Error occurred when opening output file:" <<endl; // av_err2str(ret) << std::endl;
return false;
@@ -361,6 +377,7 @@ AVStream* libav::exporter::add_stream(AVFormatContext *oc, AVCodec **codec,enum
// * the motion of the chroma plane does not match the luma plane. //
c->mb_decision = 2;
}
+
break;
default:
@@ -381,7 +398,7 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream *
// open the codec //
mutex.lock();
- ret = avcodec_open2(c, codec, NULL);
+ ret = avcodec_open2(c, codec, NULL); //OPTIONS CAN GO HERE
mutex.unlock();
if (ret < 0) {
//fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret));
@@ -415,6 +432,8 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream *
}
}
+
+
// copy data and linesize picture pointers to frame //
*((AVPicture *)frame) = dst_picture;
diff --git a/rotord/src/libavwrapper.h b/rotord/src/libavwrapper.h
index 989d045..8ce22eb 100644
--- a/rotord/src/libavwrapper.h
+++ b/rotord/src/libavwrapper.h
@@ -14,8 +14,13 @@ extern "C" {
#include <libavutil/pixfmt.h>
#include <libavutil/opt.h>
#include <libswscale/swscale.h>
+<<<<<<< HEAD
// ?????????
//#include <libavformat/movenc.h>
+=======
+ //?????????
+ //#include <libavformat/movenc.h>
+>>>>>>> e8bfadcde7063ebaac5c8121747109dd574abf61
}
#include <string>
diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp
index 8c9c6e4..718d6ae 100644
--- a/rotord/src/rendercontext.cpp
+++ b/rotord/src/rendercontext.cpp
@@ -179,22 +179,23 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H
}
if (command.commands[1]=="graph") {
if (command.method=="GET") {
- if (graph.loaded) {
- status=HTTPResponse::HTTP_OK;
- //XML.addValue("patchbay",graph.toString());
- logger.information("Requested graph");
- XML.loadFromBuffer(graph.graphToString());
- }
- else {
- if (state==LOADING_GRAPH) {
- logger.error("ERROR: graph still loading");
- XML.addValue("error","graph still loading");
+ if (state!=LOADING_GRAPH) {
+ if (graph.loaded) {
+ status=HTTPResponse::HTTP_OK;
+ //XML.addValue("patchbay",graph.toString());
+ logger.information("Graph loaded");
+ //XML.loadFromBuffer(graph.graphToString());
+ XML.addValue("status","Graph loaded");
}
else {
logger.error("ERROR: graph not loaded");
- XML.addValue("error","graph not loaded");
+ XML.addValue("error","graph not loaded");
}
}
+ else {
+ logger.error("ERROR: Graph loading");
+ XML.addValue("error","Graph loading");
+ }
}
if (command.method=="PUT") { //get new graph from file
if (command.body!="") {