Skip to content

Commit

Permalink
Remove unused items (#47)
Browse files Browse the repository at this point in the history
-remove future and mutex refence.  t used
-Removing GL/gl.h resolves Renesas m3ulcb build break
-resolve lgtm build errors (GCC)

Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
  • Loading branch information
jwinarske authored Mar 2, 2022
1 parent 906f89a commit b18a478
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 31 deletions.
50 changes: 20 additions & 30 deletions shell/static_plugins/gstreamer/gstreamer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
#include "gstreamer.h"

#include <flutter/fml/logging.h>
#include <flutter/fml/paths.h>
#include <flutter/standard_message_codec.h>
#include <flutter/standard_method_codec.h>
#include <gst/gst.h>
#include <gst/video/video.h>
#include <cassert>
#include <chrono>
#include <cstdio>
#include <future>
#include <mutex>
#include <thread>

extern "C" {
#include <libavformat/avformat.h>
}
#include <EGL/egl.h>
#include <flutter/event_stream_handler_functions.h>
#include <flutter/fml/paths.h>
#include <flutter/standard_message_codec.h>
#include <cassert>
#include <thread>

#include "engine.h"
#include "hexdump.h"
#include "nv12.h"
Expand Down Expand Up @@ -289,7 +283,6 @@ static void prepare(CustomData* data) {
static gboolean sync_bus_call(GstBus* bus, GstMessage* msg, CustomData* data) {
GError* err;
gchar* debug_info;
std::future<void> handle_fut;
int64_t textureId =
data->texture == nullptr ? 0 : data->texture->GetTextureId();
switch (GST_MESSAGE_TYPE(msg)) {
Expand All @@ -304,7 +297,7 @@ static gboolean sync_bus_call(GstBus* bus, GstMessage* msg, CustomData* data) {
g_free(debug_info);
g_main_loop_quit(data->main_loop);
break;
case GST_MESSAGE_EOS:
case GST_MESSAGE_EOS: {
FML_DLOG(INFO) << "EOS " << textureId;
if (data->is_looping) {
if (!gst_element_seek_simple(
Expand All @@ -316,24 +309,21 @@ static gboolean sync_bus_call(GstBus* bus, GstMessage* msg, CustomData* data) {
return TRUE;
}
// send completed event
try {
auto& codec = flutter::StandardMessageCodec::GetInstance();
flutter::EncodableValue res(flutter::EncodableMap{
{flutter::EncodableValue("event"),
flutter::EncodableValue("completed")},
});
auto result = codec.EncodeMessage(res);

std::stringstream ss_event;
ss_event << kChannelGstreamerEventPrefix << textureId;
auto event_name = ss_event.str();
FML_DLOG(INFO) << "send event completed " << event_name;
data->engine->SendPlatformMessage(event_name.c_str(), result->data(),
result->size());
} catch (std::future_error& e) {
FML_DLOG(ERROR) << e.what();
}
auto& codec = flutter::StandardMessageCodec::GetInstance();
flutter::EncodableValue res(flutter::EncodableMap{
{flutter::EncodableValue("event"),
flutter::EncodableValue("completed")},
});
auto result = codec.EncodeMessage(res);

std::stringstream ss_event;
ss_event << kChannelGstreamerEventPrefix << textureId;
auto event_name = ss_event.str();
FML_DLOG(INFO) << "send event completed " << event_name;
data->engine->SendPlatformMessage(event_name.c_str(), result->data(),
result->size());
break;
}
case GST_MESSAGE_STATE_CHANGED: {
GstState old_state, new_state, pending_state;
gst_message_parse_state_changed(msg, &old_state, &new_state,
Expand Down
1 change: 0 additions & 1 deletion shell/static_plugins/gstreamer/nv12.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "egl_window.h"

#include <GL/gl.h>
#include <GLES3/gl3.h>

namespace nv12 {
Expand Down

0 comments on commit b18a478

Please sign in to comment.