ISAAC
Overview :: Library Doc :: Server Doc :: JSON Commands

In Situ Animation of Accelerated Computations

RTMPImageConnector.hpp
Go to the documentation of this file.
1 /* This file is part of ISAAC.
2  *
3  * ISAAC is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation, either version 3 of the
6  * License, or (at your option) any later version.
7  *
8  * ISAAC is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with ISAAC. If not, see <www.gnu.org/licenses/>. */
15 
16 #pragma once
17 
18 #include "ImageConnector.hpp"
19 #include "RTPImageConnector.hpp"
20 #include "Runable.hpp"
21 #include <gst/gst.h>
22 #include <gst/gst.h>
23 #include <gst/app/gstappsrc.h>
24 
25 #define ISAAC_MAX_HEARTBEAT 200
26 
28 {
29  public:
30  RTMPImageConnector( std::string name, std::string apikey, std::string base_url, int bitrate = 400, bool dummy_audio = false );
31  errorCode init(int minport,int maxport);
32  errorCode run();
33  std::string getName();
34  static void* heartbeatFunction(void* ptr);
35  static uint64_t getTicksMs();
36  static void addFrame( ImageBuffer* image, GstAppSrc* appsrc, InsituConnectorGroup* group);
37  private:
38  InsituConnectorGroup* group;
39  std::string name;
40  std::string apikey;
41  std::string base_url;
42  GstElement *appsrc;
43  GstElement *audiotestsrc;
44  GstElement *voaacenc;
45  GstElement *videoconvert;
46  GstElement *capsfilter;
47  GstElement *videorate_capsfilter;
48  GstElement *videorate;
49  GstElement *x264enc;
50  GstElement *flvmux;
51  GstElement *rtmpsink;
52  GstElement *pipeline;
53  GstElement *bin;
54  pthread_mutex_t heartbeat_mutex;
55  pthread_t heartbeat_thread;
56  uint64_t heartbeat;
57  ImageBuffer* heartbeat_image;
58  volatile bool heartbeat_finish;
59  int bitrate;
60  bool dummy_audio;
61 };
static void addFrame(ImageBuffer *image, GstAppSrc *appsrc, InsituConnectorGroup *group)
static uint64_t getTicksMs()
RTMPImageConnector(std::string name, std::string apikey, std::string base_url, int bitrate=400, bool dummy_audio=false)
static void * heartbeatFunction(void *ptr)
int errorCode
Definition: Common.hpp:24
errorCode init(int minport, int maxport)