Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'ibedek-master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Mar 13, 2021
2 parents fbddd3b + b3b601c commit 528088d
Show file tree
Hide file tree
Showing 27 changed files with 387 additions and 342 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ build/
/pubspec.lock
/.packages
/.gradle/

.settings/
.project
.classpath
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 0.4.0-nullsafety.0
- Migrated to nullsafety
- Updated example application, changed example to use full-gpl ffmpeg package (video stabilization not present in full package)
- Fixes issue #266 and possibly #246

### Known issues
- Burn subtitles in example not working properly (stuck at Burning subtitles)


## 0.3.1
- Adds mavenCentral() repository for Android
- Minor updates in the test application
Expand Down
24 changes: 16 additions & 8 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,36 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_ffmpeg_example"
android:icon="@mipmap/ic_launcher"
tools:replace="android:label">
tools:replace="android:label">

<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<!-- Specify that the launch screen should continue being displayed -->
<!-- until Flutter renders its first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />

<!-- Theme to apply as soon as Flutter begins rendering frames -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package com.arthenica.flutter.ffmpeg.flutterffmpegexample;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}

}
5 changes: 5 additions & 0 deletions example/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@@android:color/white</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ subprojects {
project.evaluationDependsOn(':app')
}

ext.flutterFFmpegPackage = 'full'
ext.flutterFFmpegPackage = 'full-gpl'

task clean(type: Delete) {
delete rootProject.buildDir
Expand Down
14 changes: 7 additions & 7 deletions example/lib/audio_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ import 'package:flutter_ffmpeg_example/video_util.dart';
import 'util.dart';

class AudioTab {
RefreshablePlayerDialogFactory _refreshablePlayerDialogFactory;
String _selectedCodec;
String _outputText;
late RefreshablePlayerDialogFactory _refreshablePlayerDialogFactory;
late String _selectedCodec;
String _outputText = "";

void init(RefreshablePlayerDialogFactory refreshablePlayerDialogFactory) {
_refreshablePlayerDialogFactory = refreshablePlayerDialogFactory;
List<DropdownMenuItem<String>> videoCodecList = getAudioCodecList();
_selectedCodec = videoCodecList[0].value;
_selectedCodec = videoCodecList[0].value!;
clearLog();
}

Expand All @@ -65,8 +65,8 @@ class AudioTab {
_outputText = "";
}

void changedAudioCodec(String selectedCodec) {
_selectedCodec = selectedCodec;
void changedAudioCodec(String? selectedCodec) {
_selectedCodec = selectedCodec!;
_refreshablePlayerDialogFactory.refresh();
}

Expand Down Expand Up @@ -222,7 +222,7 @@ class AudioTab {
}

List<DropdownMenuItem<String>> getAudioCodecList() {
List<DropdownMenuItem<String>> list = new List();
List<DropdownMenuItem<String>> list = List.empty(growable: true);

list.add(new DropdownMenuItem(
value: "mp2 (twolame)",
Expand Down
6 changes: 3 additions & 3 deletions example/lib/command_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import 'flutter_ffmpeg_api_wrapper.dart';
import 'util.dart';

class CommandTab {
Refreshable _refreshable;
TextEditingController _commandText;
String _outputText;
late Refreshable _refreshable;
late TextEditingController _commandText;
String _outputText = "";

void init(Refreshable refreshable) {
_refreshable = refreshable;
Expand Down
10 changes: 5 additions & 5 deletions example/lib/concurrent_execution_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import 'package:flutter_ffmpeg_example/video_util.dart';
import 'util.dart';

class ConcurrentExecutionTab {
Refreshable _refreshable;
String _outputText;
int _executionId1;
int _executionId2;
int _executionId3;
late Refreshable _refreshable;
String _outputText = "";
late int _executionId1;
late int _executionId2;
late int _executionId3;

void init(Refreshable refreshable) {
_refreshable = refreshable;
Expand Down
6 changes: 3 additions & 3 deletions example/lib/flutter_ffmpeg_api_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ final FlutterFFmpegConfig _flutterFFmpegConfig = new FlutterFFmpegConfig();
final FlutterFFmpeg _flutterFFmpeg = new FlutterFFmpeg();
final FlutterFFprobe _flutterFFprobe = new FlutterFFprobe();

void enableLogCallback(LogCallback callback) {
void enableLogCallback(LogCallback? callback) {
_flutterFFmpegConfig.enableLogCallback(callback);
}

void enableStatisticsCallback(StatisticsCallback callback) {
void enableStatisticsCallback(StatisticsCallback? callback) {
_flutterFFmpegConfig.enableStatisticsCallback(callback);
}

Expand Down Expand Up @@ -153,6 +153,6 @@ Future<List<FFmpegExecution>> listFFmpegExecutions() async {
return await _flutterFFmpeg.listExecutions();
}

List<String> parseArguments(command) {
List<String>? parseArguments(command) {
return FlutterFFmpeg.parseArguments(command);
}
123 changes: 59 additions & 64 deletions example/lib/https_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class HttpsTab {
static const String HTTPS_TEST_DEFAULT_URL =
"https://download.blender.org/peach/trailer/trailer_1080p.ogg";

Refreshable _refreshable;
TextEditingController _urlText;
String _outputText;
late Refreshable _refreshable;
late TextEditingController _urlText;
String _outputText = "";

void init(Refreshable refreshable) {
_refreshable = refreshable;
Expand Down Expand Up @@ -79,107 +79,102 @@ class HttpsTab {
getMediaInformation(testUrl).then((information) {
if (information.getMediaProperties() != null) {
ffprint("---");
if (information.getMediaProperties().containsKey('filename')) {
ffprint('Path: ${information.getMediaProperties()['filename']}');
Map<dynamic, dynamic> mediaProperties =
information.getMediaProperties()!;
if (mediaProperties.containsKey('filename')) {
ffprint('Path: ${mediaProperties['filename']}');
}
if (information.getMediaProperties().containsKey('format_name')) {
ffprint("Format: " + information.getMediaProperties()['format_name']);
if (mediaProperties.containsKey('format_name')) {
ffprint("Format: " + mediaProperties['format_name']);
}
if (information.getMediaProperties().containsKey('bit_rate')) {
ffprint("Bitrate: " + information.getMediaProperties()['bit_rate']);
if (mediaProperties.containsKey('bit_rate')) {
ffprint("Bitrate: " + mediaProperties['bit_rate']);
}
if (information.getMediaProperties().containsKey('duration')) {
ffprint("Duration: " + information.getMediaProperties()['duration']);
if (mediaProperties.containsKey('duration')) {
ffprint("Duration: " + mediaProperties['duration']);
}
if (information.getMediaProperties().containsKey('start_time')) {
ffprint(
"Start time: " + information.getMediaProperties()['start_time']);
if (mediaProperties.containsKey('start_time')) {
ffprint("Start time: " + mediaProperties['start_time']);
}
if (information.getMediaProperties().containsKey('nb_streams')) {
ffprint("Number of streams: " +
information.getMediaProperties()['nb_streams'].toString());
if (mediaProperties.containsKey('nb_streams')) {
ffprint(
"Number of streams: " + mediaProperties['nb_streams'].toString());
}
Map<dynamic, dynamic> tags = information.getMediaProperties()['tags'];
Map<dynamic, dynamic>? tags = mediaProperties['tags'];
if (tags != null) {
tags.forEach((key, value) {
ffprint("Tag: " + key + ":" + value);
});
}

List<StreamInformation> streams = information.getStreams();
List<StreamInformation>? streams = information.getStreams();
if (streams != null) {
for (var i = 0; i < streams.length; ++i) {
StreamInformation stream = streams[i];
ffprint("---");
if (stream.getAllProperties().containsKey('index')) {
ffprint("Stream index: " +
stream.getAllProperties()['index'].toString());
}
if (stream.getAllProperties().containsKey('codec_type')) {
ffprint(
"Stream type: " + stream.getAllProperties()['codec_type']);
Map<dynamic, dynamic> streamProperties = stream.getAllProperties();
if (streamProperties.containsKey('index')) {
ffprint("Stream index: " + streamProperties['index'].toString());
}
if (stream.getAllProperties().containsKey('codec_name')) {
ffprint(
"Stream codec: " + stream.getAllProperties()['codec_name']);
if (streamProperties.containsKey('codec_type')) {
ffprint("Stream type: " + streamProperties['codec_type']);
}
if (stream.getAllProperties().containsKey('codec_long_name')) {
ffprint("Stream full codec: " +
stream.getAllProperties()['codec_long_name']);
if (streamProperties.containsKey('codec_name')) {
ffprint("Stream codec: " + streamProperties['codec_name']);
}
if (stream.getAllProperties().containsKey('pix_fmt')) {
ffprint("Stream format: " + stream.getAllProperties()['pix_fmt']);
if (streamProperties.containsKey('codec_long_name')) {
ffprint(
"Stream full codec: " + streamProperties['codec_long_name']);
}
if (stream.getAllProperties().containsKey('width')) {
ffprint("Stream width: " +
stream.getAllProperties()['width'].toString());
if (streamProperties.containsKey('pix_fmt')) {
ffprint("Stream format: " + streamProperties['pix_fmt']);
}
if (stream.getAllProperties().containsKey('height')) {
ffprint("Stream height: " +
stream.getAllProperties()['height'].toString());
if (streamProperties.containsKey('width')) {
ffprint("Stream width: " + streamProperties['width'].toString());
}
if (stream.getAllProperties().containsKey('bit_rate')) {
if (streamProperties.containsKey('height')) {
ffprint(
"Stream bitrate: " + stream.getAllProperties()['bit_rate']);
"Stream height: " + streamProperties['height'].toString());
}
if (stream.getAllProperties().containsKey('sample_rate')) {
ffprint("Stream sample rate: " +
stream.getAllProperties()['sample_rate']);
if (streamProperties.containsKey('bit_rate')) {
ffprint("Stream bitrate: " + streamProperties['bit_rate']);
}
if (stream.getAllProperties().containsKey('sample_fmt')) {
ffprint("Stream sample format: " +
stream.getAllProperties()['sample_fmt']);
if (streamProperties.containsKey('sample_rate')) {
ffprint("Stream sample rate: " + streamProperties['sample_rate']);
}
if (streamProperties.containsKey('sample_fmt')) {
ffprint(
"Stream sample format: " + streamProperties['sample_fmt']);
}
if (stream.getAllProperties().containsKey('channel_layout')) {
if (streamProperties.containsKey('channel_layout')) {
ffprint("Stream channel layout: " +
stream.getAllProperties()['channel_layout']);
streamProperties['channel_layout']);
}
if (stream.getAllProperties().containsKey('sample_aspect_ratio')) {
if (streamProperties.containsKey('sample_aspect_ratio')) {
ffprint("Stream sample aspect ratio: " +
stream.getAllProperties()['sample_aspect_ratio']);
streamProperties['sample_aspect_ratio']);
}
if (stream.getAllProperties().containsKey('display_aspect_ratio')) {
if (streamProperties.containsKey('display_aspect_ratio')) {
ffprint("Stream display aspect ratio: " +
stream.getAllProperties()['display_aspect_ratio']);
streamProperties['display_aspect_ratio']);
}
if (stream.getAllProperties().containsKey('avg_frame_rate')) {
if (streamProperties.containsKey('avg_frame_rate')) {
ffprint("Stream average frame rate: " +
stream.getAllProperties()['avg_frame_rate']);
streamProperties['avg_frame_rate']);
}
if (stream.getAllProperties().containsKey('r_frame_rate')) {
if (streamProperties.containsKey('r_frame_rate')) {
ffprint("Stream real frame rate: " +
stream.getAllProperties()['r_frame_rate']);
streamProperties['r_frame_rate']);
}
if (stream.getAllProperties().containsKey('time_base')) {
ffprint("Stream time base: " +
stream.getAllProperties()['time_base']);
if (streamProperties.containsKey('time_base')) {
ffprint("Stream time base: " + streamProperties['time_base']);
}
if (stream.getAllProperties().containsKey('codec_time_base')) {
if (streamProperties.containsKey('codec_time_base')) {
ffprint("Stream codec time base: " +
stream.getAllProperties()['codec_time_base']);
streamProperties['codec_time_base']);
}

Map<dynamic, dynamic> tags = stream.getAllProperties()['tags'];
Map<dynamic, dynamic>? tags = streamProperties['tags'];
if (tags != null) {
tags.forEach((key, value) {
ffprint("Stream tag: " + key + ":" + value);
Expand Down
Loading

0 comments on commit 528088d

Please sign in to comment.