add
This commit is contained in:
@@ -94,19 +94,19 @@ GstFlowReturn new_sample(GstAppSink* appsink, gpointer data) {
|
||||
static int framecount = 0;
|
||||
framecount++;
|
||||
|
||||
std::cout << "nnew frame " << framecount << std::endl;
|
||||
//std::cout << "nnew frame " << framecount << std::endl;
|
||||
|
||||
GstSample* sample = gst_app_sink_pull_sample(appsink);
|
||||
GstCaps* caps = gst_sample_get_caps(sample);
|
||||
GstBuffer* buffer = gst_sample_get_buffer(sample);
|
||||
|
||||
const auto& n_memory = gst_buffer_n_memory(buffer);
|
||||
std::cout << "n_memory = " << n_memory << std::endl;
|
||||
std::cout << "buffer->pts = " << buffer->pts << std::endl;
|
||||
std::cout << "buffer->dts = " << buffer->dts << std::endl;
|
||||
std::cout << "buffer->duration = " << buffer->duration << std::endl;
|
||||
std::cout << "buffer->offset = " << buffer->offset << std::endl;
|
||||
std::cout << "buffer->offset_end = " << buffer->offset_end << std::endl;
|
||||
//std::cout << "n_memory = " << n_memory << std::endl;
|
||||
//std::cout << "buffer->pts = " << buffer->pts << std::endl;
|
||||
//std::cout << "buffer->dts = " << buffer->dts << std::endl;
|
||||
//std::cout << "buffer->duration = " << buffer->duration << std::endl;
|
||||
//std::cout << "buffer->offset = " << buffer->offset << std::endl;
|
||||
//std::cout << "buffer->offset_end = " << buffer->offset_end << std::endl;
|
||||
|
||||
const GstStructure* info = gst_sample_get_info(sample);
|
||||
|
||||
@@ -318,8 +318,8 @@ GstFlowReturn new_sample(GstAppSink* appsink, gpointer data) {
|
||||
// convert gstreamer data to OpenCV Mat, you could actually
|
||||
// resolve height / width from caps...
|
||||
|
||||
int width = 2560;
|
||||
int height = 1440;
|
||||
int width = 480;
|
||||
int height = 270;
|
||||
|
||||
GstStructure* s = gst_caps_get_structure(caps, 0);
|
||||
gboolean res = true;
|
||||
@@ -353,7 +353,7 @@ GstFlowReturn new_sample(GstAppSink* appsink, gpointer data) {
|
||||
}
|
||||
|
||||
static gboolean my_bus_callback(GstBus* bus, GstMessage* message, gpointer data) {
|
||||
g_print("Got %s message\n", GST_MESSAGE_TYPE_NAME(message));
|
||||
//g_print("Got %s message\n", GST_MESSAGE_TYPE_NAME(message));
|
||||
switch (GST_MESSAGE_TYPE(message)) {
|
||||
case GST_MESSAGE_ERROR: {
|
||||
GError* err;
|
||||
@@ -781,6 +781,7 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
else {
|
||||
std::cout << "Don't have any frames yet ..." << std::endl;
|
||||
//std::cout << "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user