Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.5.8

* Fix integration_test crash issue (Issue #890)

## 2.5.7

* Fix multiple-definition error caused by applying multiple plugins at once. (Issue #883)
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This package is not an _endorsed_ implementation of `video_player`. Therefore, y
```yaml
dependencies:
video_player: ^2.9.2
video_player_tizen: ^2.5.7
video_player_tizen: ^2.5.8
```

Then you can import `video_player` in your Dart code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_tizen/flutter_tizen.dart';
import 'package:integration_test/integration_test.dart';
import 'package:path_provider/path_provider.dart';
import 'package:video_player/video_player.dart';
Expand Down Expand Up @@ -335,6 +336,8 @@ void main() {
expect(
controller.value.duration,
const Duration(seconds: 5, milliseconds: kIsWeb ? 42 : 41),
// NOTE(seungsoo47): In Tizen(RPI), the duration is 5 seconds.
skip: isTizenProfile,
);
});

Expand Down
1 change: 1 addition & 0 deletions packages/video_player/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dev_dependencies:
sdk: flutter
flutter_test:
sdk: flutter
flutter_tizen: 0.2.5
integration_test:
sdk: flutter
integration_test_tizen:
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player_tizen
description: Tizen implementation of the video_player plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/video_player
version: 2.5.7
version: 2.5.8

environment:
sdk: ">=3.3.0 <4.0.0"
Expand Down
9 changes: 9 additions & 0 deletions packages/video_player/tizen/src/video_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ FlutterDesktopGpuSurfaceDescriptor *VideoPlayer::ObtainGpuSurface(
return gpu_surface_.get();
}

#ifdef TV_PROFILE
void VideoPlayer::InitScreenSaverApi() {
LOG_INFO("[VideoPlayer] InitScreenSaverApi()");
screensaver_handle_ = dlopen("libcapi-screensaver.so", RTLD_LAZY);
if (!screensaver_handle_) {
LOG_ERROR("[VideoPlayer] dlopen failed: %s", dlerror());
Expand Down Expand Up @@ -110,6 +112,7 @@ void VideoPlayer::InitScreenSaverApi() {
return;
}
}
#endif

VideoPlayer::VideoPlayer(flutter::PluginRegistrar *plugin_registrar,
flutter::TextureRegistrar *texture_registrar,
Expand Down Expand Up @@ -326,11 +329,13 @@ void VideoPlayer::Pause() {
throw VideoPlayerError("player_pause failed", get_error_message(ret));
}

#ifdef TV_PROFILE
if (timer_) {
LOG_DEBUG("[VideoPlayer] Delete ecore timer.");
ecore_timer_del(timer_);
timer_ = nullptr;
}
#endif

SendIsPlayingStateUpdate(false);
}
Expand Down Expand Up @@ -425,6 +430,7 @@ void VideoPlayer::Dispose() {
texture_registrar_ = nullptr;
}

#ifdef TV_PROFILE
if (screensaver_handle_) {
dlclose(screensaver_handle_);
screensaver_handle_ = nullptr;
Expand All @@ -434,6 +440,7 @@ void VideoPlayer::Dispose() {
ecore_timer_del(timer_);
timer_ = nullptr;
}
#endif
}

void VideoPlayer::SetUpEventChannel(flutter::BinaryMessenger *messenger) {
Expand Down Expand Up @@ -536,6 +543,7 @@ void VideoPlayer::SendIsPlayingStateUpdate(bool is_playing) {
PushEvent(flutter::EncodableValue(result));
}

#ifdef TV_PROFILE
Eina_Bool VideoPlayer::ResetScreensaverTimeout(void *data) {
LOG_DEBUG("[VideoPlayer] Reset screen saver timeout.");

Expand All @@ -551,6 +559,7 @@ Eina_Bool VideoPlayer::ResetScreensaverTimeout(void *data) {

return ECORE_CALLBACK_RENEW;
}
#endif

void VideoPlayer::OnPrepared(void *data) {
LOG_DEBUG("[VideoPlayer] Player prepared.");
Expand Down
10 changes: 8 additions & 2 deletions packages/video_player/tizen/src/video_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class VideoPlayer {
void Initialize();
void SendInitialized();
void SendIsPlayingStateUpdate(bool is_playing);
#ifdef TV_PROFILE
void InitScreenSaverApi();
#endif

static void OnPrepared(void *data);
static void OnBuffering(int percent, void *data);
Expand All @@ -69,7 +71,9 @@ class VideoPlayer {
static void OnError(int error_code, void *data);
static void OnVideoFrameDecoded(media_packet_h packet, void *data);
static void ReleaseMediaPacket(void *packet);
#ifdef TV_PROFILE
static Eina_Bool ResetScreensaverTimeout(void *data);
#endif

void RequestRendering();
void OnRenderingCompleted();
Expand Down Expand Up @@ -101,9 +105,11 @@ class VideoPlayer {

SeekCompletedCallback on_seek_completed_;

void *screensaver_handle_;
#ifdef TV_PROFILE
void *screensaver_handle_ = nullptr;
ScreensaverResetTimeout screensaver_reset_timeout_;
Ecore_Timer *timer_;
Ecore_Timer *timer_ = nullptr;
#endif

Ecore_Pipe *sink_event_pipe_ = nullptr;
std::mutex queue_mutex_;
Expand Down