Android Open Source - Telecine Telecine Service






From Project

Back to project page Telecine.

License

The source code is released under:

Apache License

If you think the Android project Telecine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jakewharton.telecine;
//from  www .j  a  va2 s  .com
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.NonNull;
import javax.inject.Inject;
import javax.inject.Provider;
import timber.log.Timber;

public final class TelecineService extends Service {
  private static final String EXTRA_RESULT_CODE = "result-code";
  private static final String EXTRA_DATA = "data";

  public static Intent newIntent(Context context, int resultCode, Intent data) {
    Intent intent = new Intent(context, TelecineService.class);
    intent.putExtra(EXTRA_RESULT_CODE, resultCode);
    intent.putExtra(EXTRA_DATA, data);
    return intent;
  }

  @Inject @ShowCountdown Provider<Boolean> showCountdownProvider;
  @Inject @VideoSizePercentage Provider<Integer> videoSizePercentageProvider;

  @Inject Analytics analytics;

  private boolean running;
  private RecordingSession recordingSession;

  private final RecordingSession.Listener listener = new RecordingSession.Listener() {
    @Override public void onEnd() {
      Timber.d("Shutting down.");
      stopSelf();
    }
  };

  @Override public int onStartCommand(@NonNull Intent intent, int flags, int startId) {
    if (running) {
      Timber.d("Already running! Ignoring...");
      return START_NOT_STICKY;
    }
    Timber.d("Starting up!");
    running = true;

    int resultCode = intent.getIntExtra(EXTRA_RESULT_CODE, 0);
    Intent data = intent.getParcelableExtra(EXTRA_DATA);
    if (resultCode == 0 || data == null) {
      throw new IllegalStateException("Result code or data missing.");
    }

    ((TelecineApplication) getApplication()).inject(this);

    recordingSession =
        new RecordingSession(this, listener, resultCode, data, analytics, showCountdownProvider,
            videoSizePercentageProvider);
    recordingSession.showOverlay();

    return START_NOT_STICKY;
  }

  @Override public void onDestroy() {
    recordingSession.destroy();
    super.onDestroy();
  }

  @Override public IBinder onBind(@NonNull Intent intent) {
    throw new AssertionError("Not supported.");
  }
}




Java Source Code List

com.jakewharton.telecine.Analytics.java
com.jakewharton.telecine.BooleanPreference.java
com.jakewharton.telecine.BugsnagTree.java
com.jakewharton.telecine.CaptureHelper.java
com.jakewharton.telecine.CheatSheet.java
com.jakewharton.telecine.HideFromRecents.java
com.jakewharton.telecine.IntPreference.java
com.jakewharton.telecine.OverlayView.java
com.jakewharton.telecine.RecordingSession.java
com.jakewharton.telecine.ShowCountdown.java
com.jakewharton.telecine.TelecineActivity.java
com.jakewharton.telecine.TelecineApplication.java
com.jakewharton.telecine.TelecineModule.java
com.jakewharton.telecine.TelecineService.java
com.jakewharton.telecine.TelecineShortcutConfigureActivity.java
com.jakewharton.telecine.TelecineShortcutLaunchActivity.java
com.jakewharton.telecine.VideoSizePercentageAdapter.java
com.jakewharton.telecine.VideoSizePercentage.java