urlList = new ArrayList<>();
+ for (Uri uri : uriList) {
+ urlList.add(uri.toString());
+ }
+ ImagePreview.getInstance()
+ .setContext(BigImageViewPagerAct.this)
+ .setImageList(urlList)
+ .setShowDownButton(false)
+ .setShowCloseButton(false)
+ .setEnableDragClose(true)
+ .setEnableClickClose(false)
+ .start();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/NiubiEmptyView.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/NiubiEmptyView.java
index 1f4041d3..29dbb2a2 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/NiubiEmptyView.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/NiubiEmptyView.java
@@ -30,7 +30,7 @@ public NiubiEmptyView bind(Context context, View mRecyclerView, BaseQuickAdapter
this.context = context;
this.mAdapter = mAdapter;
// loadingView = ((Activity) context).getLayoutInflater().inflate(R.layout.activity_recycleviewallsuses_demo8_viewloading, (ViewGroup) mRecyclerView.getParent(), false);
- loadingView = ((Activity) context).getLayoutInflater().inflate(R.layout.activity_network_loading, (ViewGroup) mRecyclerView.getParent(), false);
+ loadingView = ((Activity) context).getLayoutInflater().inflate(R.layout.activity_network_loading1, (ViewGroup) mRecyclerView.getParent(), false);
loadingView_content = loadingView.findViewById(R.id.loading_notice);
imageView = loadingView.findViewById(R.id.loading_iv);
noDataView = ((Activity) context).getLayoutInflater().inflate(R.layout.activity_recycleviewallsuses_demo8_viewnodata, (ViewGroup) mRecyclerView.getParent(), false);
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ExpandableTextViewAct.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ExpandableTextViewAct.java
new file mode 100644
index 00000000..8f68050d
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ExpandableTextViewAct.java
@@ -0,0 +1,281 @@
+package com.haier.cellarette.baselibrary.expandabletextview;
+
+import android.app.AlertDialog;
+import android.content.Intent;
+import android.graphics.Color;
+import android.net.Uri;
+import android.os.Bundle;
+import android.text.Spannable;
+import android.text.SpannableString;
+import android.text.SpannableStringBuilder;
+import android.text.TextUtils;
+import android.text.method.LinkMovementMethod;
+import android.text.style.ForegroundColorSpan;
+import android.text.util.Linkify;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.text.util.LinkifyCompat;
+
+import com.ctetin.expandabletextviewlibrary.ExpandableTextView;
+import com.ctetin.expandabletextviewlibrary.app.LinkType;
+import com.ctetin.expandabletextviewlibrary.app.StatusType;
+import com.haier.cellarette.baselibrary.R;
+
+
+/**
+ * 联系我:
+ * 792075058@qq.com
+ *
+ * 博客地址:
+ * https://www.jianshu.com/p/b7a8ddc639db
+ *
+ * Github地址(您的star是对我最大的鼓励):
+ * https://github.com/MZCretin/ExpandableTextView
+ */
+public class ExpandableTextViewAct extends AppCompatActivity {
+ private ExpandableTextView[] views;
+ private TextView[] tips;
+ private String[] indexs = new String[]{
+ "3,5;6,9;10,12",
+ "3,5;6,11;12,13;21,22;27,28",
+ "2,6;7,12;13,14;22,23",
+ "3,5;6,9;10,11;19,20",
+ "3,5;6,9;10,11;19,21",
+ "3,5;6,9;10,11;14,16",
+ "3,5;6,9;10,11;14,15;20,21",
+ "3,5;6,9;10,11;14,16;21,22",
+ "3,5;6,9;10,11;14,15;20,21",
+ "4,6;7,10;11,12;15,16;21,22",
+ "4,6;7,10;11,12;15,16;24,29;40,45"
+ };
+
+ private TextView tvTips00;
+
+ private ExpandableTextView.OnLinkClickListener linkClickListener = (type, content, selfContent) -> {
+ if (type.equals(LinkType.LINK_TYPE)) {
+ Toast.makeText(ExpandableTextViewAct.this, "你点击了链接 内容是:" + content, Toast.LENGTH_SHORT).show();
+ } else if (type.equals(LinkType.MENTION_TYPE)) {
+ Toast.makeText(ExpandableTextViewAct.this, "你点击了@用户 内容是:" + content, Toast.LENGTH_SHORT).show();
+ } else if (type.equals(LinkType.SELF)) {
+ Toast.makeText(ExpandableTextViewAct.this, "你点击了自定义规则 内容是:" + content + " " + selfContent, Toast.LENGTH_SHORT).show();
+ }
+ };
+
+ private void initView() {
+ views = new ExpandableTextView[12];
+ tips = new TextView[11];
+ views[0] = findViewById(R.id.ep_01);
+ views[1] = findViewById(R.id.ep_02);
+ views[2] = findViewById(R.id.ep_03);
+ views[3] = findViewById(R.id.ep_04);
+ views[4] = findViewById(R.id.ep_05);
+ views[5] = findViewById(R.id.ep_06);
+ views[6] = findViewById(R.id.ep_07);
+ views[7] = findViewById(R.id.ep_08);
+ views[8] = findViewById(R.id.ep_09);
+ views[9] = findViewById(R.id.ep_10);
+ views[10] = findViewById(R.id.ep_11);
+ views[11] = findViewById(R.id.ep_12);
+ tips[0] = findViewById(R.id.tv_tips01);
+ tips[1] = findViewById(R.id.tv_tips02);
+ tips[2] = findViewById(R.id.tv_tips03);
+ tips[3] = findViewById(R.id.tv_tips04);
+ tips[4] = findViewById(R.id.tv_tips05);
+ tips[5] = findViewById(R.id.tv_tips06);
+ tips[6] = findViewById(R.id.tv_tips07);
+ tips[7] = findViewById(R.id.tv_tips08);
+ tips[8] = findViewById(R.id.tv_tips09);
+ tips[9] = findViewById(R.id.tv_tips10);
+ tips[10] = findViewById(R.id.tv_tips11);
+ tvTips00 = findViewById(R.id.tv_tips00);
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_expandabletextview);
+
+ initView();
+
+ setTips();
+ String yourText = " 我所认识的中国,http://www.baidu.com 强大、友好 --习大大。@奥特曼 “一带一路”经济带带动了沿线国家的经济发展,促进我国与他国的友好往来和贸易发展,可谓“双赢”,Github地址。 自古以来,中国以和平、友好的面孔示人。汉武帝派张骞出使西域,开辟丝绸之路,增进与西域各国的友好往来。http://www.baidu.com 胡麻、胡豆、香料等食材也随之传入中国,汇集于中华美食。@RNG 漠漠古道,驼铃阵阵,这条路奠定了“一带一路”的基础,让世界认识了中国。";
+// String yourText = "1、哈哈\n2、哈哈\n3、哈哈\n4、哈哈\n5、哈哈\n6、哈哈\n7、哈哈\n8、哈哈\n9、哈哈\n1、哈哈";
+// String yourText = "1\n2考虑\n3考虑\n4考虑\n5考虑\n6考虑";
+
+ setContent(yourText, true);
+
+ //在RecyclerView中查看效果
+ findViewById(R.id.ll_recyclerview).setOnClickListener(v -> {
+ startActivity(new Intent(this, ShowInRecyclerViewActivity.class));
+ });
+
+ //广告 从后台到app都是我自己一个人开发的 希望得到你的支持
+ findViewById(R.id.ll_ad).setOnClickListener(v -> {
+ Uri uri = Uri.parse("http://a.app.qq.com/o/simple.jsp?pkgname=com.cretin");
+ Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+ startActivity(intent);
+ });
+ }
+
+ /**
+ * 设置内容
+ *
+ * @param yourText
+ * @param d
+ */
+ private void setContent(String yourText, boolean d) {
+ //1、正常带链接和@用户,没有展开和收回功能
+ views[0].setContent(yourText);
+ views[0].setLinkClickListener(linkClickListener);
+
+ //2、正常带链接,不带@用户,有展开和收回功能,有切换动画
+ views[1].setContent(yourText);
+ views[1].setLinkClickListener(linkClickListener);
+ views[11].setContent(yourText);
+ views[11].setLinkClickListener(linkClickListener);
+ //添加展开和收回操作
+ views[1].setExpandOrContractClickListener(type -> {
+ if (type.equals(StatusType.STATUS_CONTRACT)) {
+ Toast.makeText(ExpandableTextViewAct.this, "收回操作", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(ExpandableTextViewAct.this, "展开操作", Toast.LENGTH_SHORT).show();
+ }
+ });
+ //添加展开和收回操作 只触发点击 不真正触发展开和收回操作
+ views[11].setExpandOrContractClickListener(type -> {
+ if (type.equals(StatusType.STATUS_CONTRACT)) {
+ Toast.makeText(ExpandableTextViewAct.this, "收回操作,不真正触发收回操作", Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(ExpandableTextViewAct.this, "展开操作,不真正触发展开操作", Toast.LENGTH_SHORT).show();
+ }
+ }, false);
+
+ //3、正常不带链接,不带@用户,有展开和收回功能,有切换动画
+ views[2].setContent(yourText);
+ views[2].setLinkClickListener(linkClickListener);
+
+ //4、正常带链接和@用户,有展开和收回功能,有切换动画
+ views[3].setContent(yourText);
+ views[3].setLinkClickListener(linkClickListener);
+ views[3].setNeedSelf(true);
+
+ //5、正常带链接和@用户,有展开和收回功能,没有切换动画
+ views[4].setContent(yourText);
+ views[4].setLinkClickListener(linkClickListener);
+
+ //6、正常带链接和@用户,有展开,没有收回功能
+ views[5].setContent(yourText);
+ views[5].setLinkClickListener(linkClickListener);
+
+ //7、正常带链接和@用户,有展开,有收回功能,带附加内容(比如时间)
+ views[6].setContent(yourText);
+ views[6].setEndExpendContent(" 1小时前");
+ views[6].setLinkClickListener(linkClickListener);
+
+ //8、正常带链接和@用户,有展开,没有收回功能,带附加内容(比如时间)
+ views[7].setContent(yourText);
+ views[7].setEndExpendContent(" 1小时前");
+ views[7].setLinkClickListener(linkClickListener);
+
+ //9、正常带链接和@用户,有展开,有收回功能,有'展开'和'收起'始终靠右显示的功能
+ views[8].setContent(yourText);
+ views[8].setLinkClickListener(linkClickListener);
+ //需要先开启始终靠右显示的功能
+ views[8].setNeedAlwaysShowRight(true);
+
+ //10、正常带链接和@用户,有展开,有收回功能,带自定义规则(解析[标题](规则)并处理,例如对一些字段进行自定义处理,比如文字中的"--习大大" 和 "Gitbub地址")
+ //如果你需要对一些字段进行自定义处理,比如文字中的"--习大大" 和 "Gitbub地址",你需要按照下面的形式去组装数据,这样控件就可以自动去解析并展示。
+ /**
+ * 如需使用此功能,需要先开启
+ * app:ep_need_self="true"
+ * views[8].setNeedSelf(true);
+ */
+ String yourText1 = "";
+ if (d) {
+ yourText1 = " 我所认识的中国,强大、友好,[--习大大](schema_jump_userinfo)。[http://www.baidu.com](http://www.baidu.com),@奥特曼 “一带一路”经济带带动了沿线国家的经济发展,促进我国与他国的友好往来和贸易发展,可谓“双赢”,[Github地址](https://github.com/MZCretin/ExpandableTextView)。http://www.baidu.com 自古以来,中国以和平、友好的面孔示人。汉武帝派张骞出使西域,开辟丝绸之路,增进与西域各国的友好往来。http://www.baidu.com 胡麻、胡豆、香料等食材也随之传入中国,汇集于中华美食。@RNG 漠漠古道,驼铃阵阵,这条路奠定了“一带一路”的基础,让世界认识了中国。";
+ } else {
+ tips[9].setText("10、正常带链接和@用户,有展开,有收回功能,带自定义规则");
+ yourText1 = yourText;
+ setTips();
+ }
+ views[9].setContent(yourText1);
+ views[9].setLinkClickListener(linkClickListener);
+ //需要先开启
+ views[9].setNeedSelf(true);
+
+ //11、正常带链接和@用户,有展开,有收回功能,文本中链接不转换成网页链接的文本提示
+ views[10].setContent(yourText);
+ views[10].setLinkClickListener(linkClickListener);
+ //监听是否初始化完成 在这里可以获取是否支持展开/收回
+ views[10].setOnGetLineCountListener(new ExpandableTextView.OnGetLineCountListener() {
+ @Override
+ public void onGetLineCount(int lineCount, boolean canExpand) {
+ Toast.makeText(ExpandableTextViewAct.this, "行数:" + lineCount + " 是否满足展开条件:" + canExpand, Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+
+ /**
+ * 设置tips
+ */
+ private void setTips() {
+ //处理最上边的Tips
+ final SpannableString value = SpannableString.valueOf(tvTips00.getText());
+ LinkifyCompat.addLinks(value, Linkify.ALL);
+ tvTips00.setMovementMethod(LinkMovementMethod.getInstance());
+ tvTips00.setText(value);
+
+ //处理剩下的
+ for (int i = 0; i < indexs.length; i++) {
+ String index = indexs[i];
+ TextView view = tips[i];
+ String[] split = index.split(";");
+ SpannableStringBuilder spannableStringBuilder =
+ new SpannableStringBuilder(view.getText());
+ for (String s :
+ split) {
+ int x = Integer.parseInt(s.split(",")[0]) + 2;
+ int y = Integer.parseInt(s.split(",")[1]) + 2;
+ spannableStringBuilder.setSpan(
+ new ForegroundColorSpan(Color.parseColor("#FF6200")),
+ x, y, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
+ }
+ view.setText(spannableStringBuilder);
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.menu_layout, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ View view = LayoutInflater.from(this).inflate(R.layout.dialog_input, null);
+ new AlertDialog.Builder(this)
+ .setMessage("请输入将要替换的内容:")
+ .setTitle("提示")
+ .setView(view)
+ .setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
+ .setPositiveButton("确定", (dialog, which) -> {
+ EditText editText = view.findViewById(R.id.ed_content);
+ String string = editText.getText().toString();
+ if (TextUtils.isEmpty(string)) {
+ Toast.makeText(this, "内容不能为空", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ setContent(string, false);
+ dialog.dismiss();
+ })
+ .show();
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ShowInRecyclerViewActivity.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ShowInRecyclerViewActivity.java
new file mode 100644
index 00000000..da1ebf7e
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ShowInRecyclerViewActivity.java
@@ -0,0 +1,172 @@
+package com.haier.cellarette.baselibrary.expandabletextview;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.DividerItemDecoration;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.ctetin.expandabletextviewlibrary.ExpandableTextView;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.haier.cellarette.baselibrary.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ShowInRecyclerViewActivity extends AppCompatActivity {
+ private RecyclerView recyclerView;
+ private MyRecyclerViewAdapter adapter;
+ private List list;
+
+ private FloatingActionButton floatingActionButton;
+
+ //是需要保存展开或收回状态
+ private boolean flag = true;
+ private String content;
+
+ private String yourText = "我所认识的中国,强大、友好我所认识的中国,强大、友好。@奥特曼 “一带一路”经济带带动了沿线国家的经济发展,促进我国与他国的友好往来和贸易发展,可谓“双赢”。http://www.baidu.com 自古以来,中国以和平、友好的面孔示人。汉武帝派张骞出使西域,开辟丝绸之路,增进与西域各国的友好往来。http://www.baidu.com 胡麻、胡豆、香料等食材也随之传入中国,汇集于中华美食。@RNG 漠漠古道,驼铃阵阵,这条路奠定了“一带一路”的基础,让世界认识了中国。";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_show_in_recycler_view);
+
+ recyclerView = findViewById(R.id.recyclerview);
+ floatingActionButton = findViewById(R.id.float_btn);
+
+ list = new ArrayList<>();
+ changeStateAndSetData(null, false);
+
+ floatingActionButton.setOnClickListener(v -> changeStateAndSetData(content, true));
+ }
+
+ /**
+ * 切换状态
+ */
+ private void changeStateAndSetData(String content, boolean change) {
+ if (change)
+ flag = !flag;
+ list.clear();
+ if (flag) {
+ Toast.makeText(this, "保留之前的展开或收回状态", Toast.LENGTH_SHORT).show();
+ floatingActionButton.setImageResource(R.mipmap.green);
+ for (int i = 0; i < 50; i++) {
+ if (TextUtils.isEmpty(content))
+ list.add(new ViewModelWithFlag("第" + (i + 1) + "条数据:" + yourText));
+ else
+ list.add(new ViewModelWithFlag("第" + (i + 1) + "条数据:" + content));
+ }
+ } else {
+ Toast.makeText(this, "不保留之前的展开或收回状态", Toast.LENGTH_SHORT).show();
+ floatingActionButton.setImageResource(R.mipmap.gray);
+ for (int i = 0; i < 50; i++) {
+ if (TextUtils.isEmpty(content))
+ list.add(new ViewModel("第" + (i + 1) + "条数据:" + yourText));
+ else
+ list.add(new ViewModel("第" + (i + 1) + "条数据:" + content));
+ }
+ }
+ adapter = new MyRecyclerViewAdapter(this, list);
+ recyclerView.setLayoutManager(new LinearLayoutManager(this));
+ recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
+ recyclerView.setAdapter(adapter);
+ adapter.notifyDataSetChanged();
+ }
+
+
+ public class MyRecyclerViewAdapter extends RecyclerView.Adapter {
+ private Context mContext;
+ private List dataList;
+
+ public MyRecyclerViewAdapter(Context context, List list) {
+ this.mContext = context;
+ this.dataList = list;
+ }
+
+ @Override
+ public RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(mContext).inflate(R.layout.item_text, parent, false);
+ return new RecyclerHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(RecyclerHolder holder, int position) {
+ if (flag) {
+ //注意:保留状态需要在设置内容之前调用bind方法
+ holder.textView.bind((ViewModelWithFlag) list.get(position));
+ holder.textView.setContent(((ViewModelWithFlag) list.get(position)).getTitle());
+ } else {
+ holder.textView.setContent(((ViewModel) list.get(position)).getTitle());
+ }
+ holder.textView.setLinkClickListener((type, content, selfContent) -> {
+ switch (type) {
+ case LINK_TYPE:
+ Toast.makeText(mContext, "点击链接:" + content, Toast.LENGTH_SHORT).show();
+ break;
+ case MENTION_TYPE:
+ Toast.makeText(mContext, "点击用户:" + content, Toast.LENGTH_SHORT).show();
+ break;
+ case SELF:
+ Toast.makeText(mContext, "你点击了自定义规则 内容是:" + content + " " + selfContent, Toast.LENGTH_SHORT).show();
+ break;
+ }
+ });
+ }
+
+ @Override
+ public int getItemCount() {
+ return dataList.size();
+ }
+
+ class RecyclerHolder extends RecyclerView.ViewHolder {
+ private ExpandableTextView textView;
+
+ private RecyclerHolder(View itemView) {
+ super(itemView);
+ textView = itemView.findViewById(R.id.tv_item);
+ itemView.setOnClickListener(v -> Toast.makeText(
+ ShowInRecyclerViewActivity.this, "您点击了第" + getLayoutPosition() + "个Item", Toast.LENGTH_SHORT).show());
+ }
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.menu_layout, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ View view = LayoutInflater.from(this).inflate(R.layout.dialog_input, null);
+ new AlertDialog.Builder(this)
+ .setMessage("请输入将要替换的内容:")
+ .setTitle("提示")
+ .setView(view)
+ .setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
+ .setPositiveButton("确定", (dialog, which) -> {
+ EditText editText = view.findViewById(R.id.ed_content);
+ String string = editText.getText().toString();
+ if (TextUtils.isEmpty(string)) {
+ Toast.makeText(this, "内容不能为空", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ content = string;
+ changeStateAndSetData(string, false);
+ dialog.dismiss();
+ })
+ .show();
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ViewModel.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ViewModel.java
new file mode 100644
index 00000000..e2e13d96
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ViewModel.java
@@ -0,0 +1,23 @@
+package com.haier.cellarette.baselibrary.expandabletextview;
+
+/**
+ * @date: on 2018/9/20
+ * @author: cretin
+ * @email: mxnzp_life@163.com
+ * @desc: ViewModel 不需要记住之前的状态
+ */
+public class ViewModel {
+ private String title;
+
+ public ViewModel(String title) {
+ this.title = title;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ViewModelWithFlag.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ViewModelWithFlag.java
new file mode 100644
index 00000000..b6875bdf
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/expandabletextview/ViewModelWithFlag.java
@@ -0,0 +1,44 @@
+package com.haier.cellarette.baselibrary.expandabletextview;
+
+import com.ctetin.expandabletextviewlibrary.app.StatusType;
+import com.ctetin.expandabletextviewlibrary.model.ExpandableStatusFix;
+
+/**
+ * @date: on 2018/9/20
+ * @author: cretin
+ * @email: mxnzp_life@163.com
+ * @desc: 如果你需要在滑动的时候保持之前的展开或者收起的状态
+ * 则
+ * 一、实现 ExpandableStatusFix
+ * 二、在你的model中定义一个
+ * private StatusType status;
+ * 三、实现对应的方法,将你刚刚定义的status返回,
+ * 四、并在给ExpandableTextView设置内容之前,调用bind方法
+ */
+public class ViewModelWithFlag implements ExpandableStatusFix {
+ private StatusType status;
+
+ public ViewModelWithFlag(String title) {
+ this.title = title;
+ }
+
+ private String title;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @Override
+ public void setStatus(StatusType status) {
+ this.status = status;
+ }
+
+ @Override
+ public StatusType getStatus() {
+ return status;
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/MarqueeView.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/MarqueeView.java
index df61f7e6..5b31c241 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/MarqueeView.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/MarqueeView.java
@@ -7,7 +7,6 @@
import android.view.animation.Animation;
import android.widget.ViewFlipper;
-
import androidx.annotation.AnimRes;
import androidx.annotation.Nullable;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/ComplexItemEntity.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/ComplexItemEntity.java
new file mode 100644
index 00000000..f568f9e4
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/ComplexItemEntity.java
@@ -0,0 +1,51 @@
+package com.haier.cellarette.baselibrary.marqueelibrary.ui;
+
+/**
+ * Created by GongWen on 16/12/27.
+ */
+
+public class ComplexItemEntity {
+
+ private String title;
+ private String secondTitle;
+ private String time;
+
+ public ComplexItemEntity(String title, String secondTitle, String time) {
+ this.title = title;
+ this.secondTitle = secondTitle;
+ this.time = time;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getSecondTitle() {
+ return secondTitle;
+ }
+
+ public void setSecondTitle(String secondTitle) {
+ this.secondTitle = secondTitle;
+ }
+
+ public String getTime() {
+ return time;
+ }
+
+ public void setTime(String time) {
+ this.time = time;
+ }
+
+ @Override
+ public String toString() {
+ return "{" +
+ "title='" + title + '\'' +
+ ", secondTitle='" + secondTitle + '\'' +
+ ", time='" + time + '\'' +
+ '}';
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/ComplexViewMF.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/ComplexViewMF.java
new file mode 100644
index 00000000..b2a64246
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/ComplexViewMF.java
@@ -0,0 +1,28 @@
+package com.haier.cellarette.baselibrary.marqueelibrary.ui;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.haier.cellarette.baselibrary.R;
+import com.haier.cellarette.baselibrary.marqueelibrary.MarqueeFactory;
+
+
+public class ComplexViewMF extends MarqueeFactory {
+ private LayoutInflater inflater;
+
+ public ComplexViewMF(Context mContext) {
+ super(mContext);
+ inflater = LayoutInflater.from(mContext);
+ }
+
+ @Override
+ public RelativeLayout generateMarqueeItemView(ComplexItemEntity data) {
+ RelativeLayout mView = (RelativeLayout) inflater.inflate(R.layout.complex_view, null);
+ ((TextView) mView.findViewById(R.id.title)).setText(data.getTitle());
+ ((TextView) mView.findViewById(R.id.secondTitle)).setText(data.getSecondTitle());
+ ((TextView) mView.findViewById(R.id.time)).setText(data.getTime());
+ return mView;
+ }
+}
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/MarqueeViewLibraryAct.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/MarqueeViewLibraryAct.java
new file mode 100644
index 00000000..0025a8ca
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/MarqueeViewLibraryAct.java
@@ -0,0 +1,160 @@
+package com.haier.cellarette.baselibrary.marqueelibrary.ui;
+
+import android.os.Bundle;
+import android.text.Html;
+import android.text.Spanned;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.graphics.drawable.DrawableCompat;
+
+import com.haier.cellarette.baselibrary.R;
+import com.haier.cellarette.baselibrary.marqueelibrary.MarqueeFactory;
+import com.haier.cellarette.baselibrary.marqueelibrary.MarqueeView;
+import com.haier.cellarette.baselibrary.marqueelibrary.SimpleMF;
+import com.haier.cellarette.baselibrary.marqueelibrary.SimpleMarqueeView;
+import com.haier.cellarette.baselibrary.marqueelibrary.util.OnItemClickListener;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
+public class MarqueeViewLibraryAct extends AppCompatActivity {
+ private final List datas = Arrays.asList("《赋得古原草送别》", "离离原上草,一岁一枯荣。", "野火烧不尽,春风吹又生。", "远芳侵古道,晴翠接荒城。", "又送王孙去,萋萋满别情。", "测试测试测试测试测试测试测试测试测试测试测试");
+ private SimpleMarqueeView marqueeView1, marqueeView2, marqueeView5, marqueeView6;
+ private SimpleMarqueeView marqueeView3;
+ private ImageView yellowSpeaker;
+ private MarqueeView marqueeView4;
+
+ private WeakHandler mHandler = new WeakHandler();
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_marqueeviewlibrary);
+ marqueeView1 = findViewById(R.id.marqueeView1);
+ marqueeView2 = findViewById(R.id.marqueeView2);
+ marqueeView3 = findViewById(R.id.marqueeView3);
+ yellowSpeaker = findViewById(R.id.yellowSpeaker);
+ marqueeView4 = findViewById(R.id.marqueeView4);
+ marqueeView5 = findViewById(R.id.marqueeView5);
+ marqueeView6 = findViewById(R.id.marqueeView6);
+ DrawableCompat.setTint(DrawableCompat.wrap(yellowSpeaker.getDrawable().mutate()), getResources().getColor(R.color.yellow));
+
+ initMarqueeView1();
+ initMarqueeView2();
+ initMarqueeView3();
+ initMarqueeView4();
+ initMarqueeView5();
+ initMarqueeView6();
+ }
+
+ private void initMarqueeView1() {
+ SimpleMF marqueeFactory = new SimpleMF(MarqueeViewLibraryAct.this);
+ marqueeFactory.setData(datas);
+ marqueeView1.setMarqueeFactory(marqueeFactory);
+ marqueeView1.startFlipping();
+ marqueeView1.setOnItemClickListener(onSimpleItemClickListener);
+ }
+
+ private void initMarqueeView2() {
+ SimpleMF marqueeFactory2 = new SimpleMF(MarqueeViewLibraryAct.this);
+ marqueeFactory2.setData(datas);
+ marqueeView2.setMarqueeFactory(marqueeFactory2);
+ marqueeView2.startFlipping();
+ marqueeView2.setOnItemClickListener(onSimpleItemClickListener);
+ }
+
+ private void initMarqueeView3() {
+ SimpleMF marqueeFactory3 = new SimpleMF<>(MarqueeViewLibraryAct.this);
+ List datas3 = new ArrayList<>();
+ datas3.add(Html.fromHtml("《赋得古原草送别》"));
+ datas3.add(Html.fromHtml("离离原上草,一岁一枯荣。"));
+ datas3.add(Html.fromHtml("野火烧不尽,春风吹又生。"));
+ datas3.add(Html.fromHtml("远芳侵古道,晴翠接荒城。"));
+ datas3.add(Html.fromHtml("又送王孙去,萋萋满别情。"));
+ marqueeFactory3.setData(datas3);
+ marqueeView3.setMarqueeFactory(marqueeFactory3);
+ marqueeView3.startFlipping();
+ marqueeView3.setOnItemClickListener(new OnItemClickListener() {
+ @Override
+ public void onItemClickListener(TextView mView, Spanned mData, int mPosition) {
+ Toast.makeText(MarqueeViewLibraryAct.this, String.format("mPosition:%s,mData:%s,mView:%s,.", mPosition, mData, mView), Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+
+ private void initMarqueeView4() {
+ List complexDatas = new ArrayList<>();
+ for (int i = 0; i < 5; i++) {
+ complexDatas.add(new ComplexItemEntity("标题 " + i, "副标题 " + i, "时间 " + i));
+ }
+ MarqueeFactory marqueeFactory = new ComplexViewMF(MarqueeViewLibraryAct.this);
+
+ marqueeFactory.setData(complexDatas);
+ marqueeView4.setOnItemClickListener(new OnItemClickListener() {
+ @Override
+ public void onItemClickListener(RelativeLayout mView, ComplexItemEntity mData, int mPosition) {
+ Toast.makeText(MarqueeViewLibraryAct.this, String.format("mPosition:%s,mData:%s,mView:%s,.", mPosition, mData, mView), Toast.LENGTH_SHORT).show();
+ }
+ });
+ marqueeView4.setInAndOutAnim(R.anim.in_top, R.anim.out_bottom);
+ marqueeView4.setMarqueeFactory(marqueeFactory);
+ marqueeView4.startFlipping();
+ }
+
+ private void initMarqueeView5() {
+ SimpleMF marqueeFactory = new SimpleMF(this);
+ marqueeFactory.setData(datas);
+ marqueeView5.setOnItemClickListener(onSimpleItemClickListener);
+ marqueeView5.setMarqueeFactory(marqueeFactory);
+ marqueeView5.startFlipping();
+ }
+
+ private void initMarqueeView6() {
+ final SimpleMF marqueeFactory = new SimpleMF<>(this);
+ marqueeFactory.setData(datas);
+ marqueeView6.setOnItemClickListener(onSimpleItemClickListener);
+ marqueeView6.setMarqueeFactory(marqueeFactory);
+ marqueeView6.startFlipping();
+
+ //测试重置数据效果
+ mHandler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ Random random = new Random();
+ int delayMillis = (random.nextInt(5) + 4) * 1000;
+ marqueeFactory.setData(datas);
+ mHandler.postDelayed(this, delayMillis);
+ }
+ }, 8000);
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ marqueeView1.startFlipping();
+ marqueeView2.startFlipping();
+ marqueeView3.startFlipping();
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ marqueeView1.stopFlipping();
+ marqueeView2.stopFlipping();
+ marqueeView3.stopFlipping();
+ }
+
+ private OnItemClickListener onSimpleItemClickListener = new OnItemClickListener() {
+ @Override
+ public void onItemClickListener(TextView mView, String mData, int mPosition) {
+ Toast.makeText(MarqueeViewLibraryAct.this, String.format("mPosition:%s,mData:%s,mView:%s,.", mPosition, mData, mView), Toast.LENGTH_SHORT).show();
+ }
+ };
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/WeakHandler.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/WeakHandler.java
new file mode 100644
index 00000000..9fcf8e72
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/marqueelibrary/ui/WeakHandler.java
@@ -0,0 +1,518 @@
+/*
+ * Copyright (c) 2014 Badoo Trading Limited
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Portions of documentation in this code are modifications based on work created and
+ * shared by Android Open Source Project and used according to terms described in the
+ * Apache License, Version 2.0
+ */
+package com.haier.cellarette.baselibrary.marqueelibrary.ui;
+
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
+
+import java.lang.ref.WeakReference;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * Memory safer implementation of android.os.Handler
+ *
+ * Original implementation of Handlers always keeps hard reference to handler in queue of execution.
+ * If you create anonymous handler and post delayed message into it, it will keep all parent class
+ * for that time in memory even if it could be cleaned.
+ *
+ * This implementation is trickier, it will keep WeakReferences to runnables and messages,
+ * and GC could collect them once WeakHandler instance is not referenced any more
+ *
+ *
+ * @see Handler
+ *
+ * Created by Dmytro Voronkevych on 17/06/2014.
+ */
+@SuppressWarnings("unused")
+public class WeakHandler {
+ private final Handler.Callback mCallback; // hard reference to Callback. We need to keep callback in memory
+ private final ExecHandler mExec;
+ private Lock mLock = new ReentrantLock();
+ @SuppressWarnings("ConstantConditions")
+ @VisibleForTesting
+ final ChainedRef mRunnables = new ChainedRef(mLock, null);
+
+ /**
+ * Default constructor associates this handler with the {@link Looper} for the
+ * current thread.
+ *
+ * If this thread does not have a looper, this handler won't be able to receive messages
+ * so an exception is thrown.
+ */
+ public WeakHandler() {
+ mCallback = null;
+ mExec = new ExecHandler();
+ }
+
+ /**
+ * Constructor associates this handler with the {@link Looper} for the
+ * current thread and takes a callback interface in which you can handle
+ * messages.
+ *
+ * If this thread does not have a looper, this handler won't be able to receive messages
+ * so an exception is thrown.
+ *
+ * @param callback The callback interface in which to handle messages, or null.
+ */
+ public WeakHandler(@Nullable Handler.Callback callback) {
+ mCallback = callback; // Hard referencing body
+ mExec = new ExecHandler(new WeakReference<>(callback)); // Weak referencing inside ExecHandler
+ }
+
+ /**
+ * Use the provided {@link Looper} instead of the default one.
+ *
+ * @param looper The looper, must not be null.
+ */
+ public WeakHandler(@NonNull Looper looper) {
+ mCallback = null;
+ mExec = new ExecHandler(looper);
+ }
+
+ /**
+ * Use the provided {@link Looper} instead of the default one and take a callback
+ * interface in which to handle messages.
+ *
+ * @param looper The looper, must not be null.
+ * @param callback The callback interface in which to handle messages, or null.
+ */
+ public WeakHandler(@NonNull Looper looper, @NonNull Handler.Callback callback) {
+ mCallback = callback;
+ mExec = new ExecHandler(looper, new WeakReference<>(callback));
+ }
+
+ /**
+ * Causes the Runnable r to be added to the message queue.
+ * The runnable will be run on the thread to which this handler is
+ * attached.
+ *
+ * @param r The Runnable that will be executed.
+ *
+ * @return Returns true if the Runnable was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting.
+ */
+ public final boolean post(@NonNull Runnable r) {
+ return mExec.post(wrapRunnable(r));
+ }
+
+ /**
+ * Causes the Runnable r to be added to the message queue, to be run
+ * at a specific time given by uptimeMillis.
+ * The time-base is {@link android.os.SystemClock#uptimeMillis}.
+ * The runnable will be run on the thread to which this handler is attached.
+ *
+ * @param r The Runnable that will be executed.
+ * @param uptimeMillis The absolute time at which the callback should run,
+ * using the {@link android.os.SystemClock#uptimeMillis} time-base.
+ *
+ * @return Returns true if the Runnable was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting. Note that a
+ * result of true does not mean the Runnable will be processed -- if
+ * the looper is quit before the delivery time of the message
+ * occurs then the message will be dropped.
+ */
+ public final boolean postAtTime(@NonNull Runnable r, long uptimeMillis) {
+ return mExec.postAtTime(wrapRunnable(r), uptimeMillis);
+ }
+
+ /**
+ * Causes the Runnable r to be added to the message queue, to be run
+ * at a specific time given by uptimeMillis.
+ * The time-base is {@link android.os.SystemClock#uptimeMillis}.
+ * The runnable will be run on the thread to which this handler is attached.
+ *
+ * @param r The Runnable that will be executed.
+ * @param uptimeMillis The absolute time at which the callback should run,
+ * using the {@link android.os.SystemClock#uptimeMillis} time-base.
+ *
+ * @return Returns true if the Runnable was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting. Note that a
+ * result of true does not mean the Runnable will be processed -- if
+ * the looper is quit before the delivery time of the message
+ * occurs then the message will be dropped.
+ *
+ * @see android.os.SystemClock#uptimeMillis
+ */
+ public final boolean postAtTime(Runnable r, Object token, long uptimeMillis) {
+ return mExec.postAtTime(wrapRunnable(r), token, uptimeMillis);
+ }
+
+ /**
+ * Causes the Runnable r to be added to the message queue, to be run
+ * after the specified amount of time elapses.
+ * The runnable will be run on the thread to which this handler
+ * is attached.
+ *
+ * @param r The Runnable that will be executed.
+ * @param delayMillis The delay (in milliseconds) until the Runnable
+ * will be executed.
+ *
+ * @return Returns true if the Runnable was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting. Note that a
+ * result of true does not mean the Runnable will be processed --
+ * if the looper is quit before the delivery time of the message
+ * occurs then the message will be dropped.
+ */
+ public final boolean postDelayed(Runnable r, long delayMillis) {
+ return mExec.postDelayed(wrapRunnable(r), delayMillis);
+ }
+
+ /**
+ * Posts a message to an object that implements Runnable.
+ * Causes the Runnable r to executed on the next iteration through the
+ * message queue. The runnable will be run on the thread to which this
+ * handler is attached.
+ * This method is only for use in very special circumstances -- it
+ * can easily starve the message queue, cause ordering problems, or have
+ * other unexpected side-effects.
+ *
+ * @param r The Runnable that will be executed.
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting.
+ */
+ public final boolean postAtFrontOfQueue(Runnable r) {
+ return mExec.postAtFrontOfQueue(wrapRunnable(r));
+ }
+
+ /**
+ * Remove any pending posts of Runnable r that are in the message queue.
+ */
+ public final void removeCallbacks(Runnable r) {
+ final WeakRunnable runnable = mRunnables.remove(r);
+ if (runnable != null) {
+ mExec.removeCallbacks(runnable);
+ }
+ }
+
+ /**
+ * Remove any pending posts of Runnable r with Object
+ * token that are in the message queue. If token is null,
+ * all callbacks will be removed.
+ */
+ public final void removeCallbacks(Runnable r, Object token) {
+ final WeakRunnable runnable = mRunnables.remove(r);
+ if (runnable != null) {
+ mExec.removeCallbacks(runnable, token);
+ }
+ }
+
+ /**
+ * Pushes a message onto the end of the message queue after all pending messages
+ * before the current time. It will be received in callback,
+ * in the thread attached to this handler.
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting.
+ */
+ public final boolean sendMessage(Message msg) {
+ return mExec.sendMessage(msg);
+ }
+
+ /**
+ * Sends a Message containing only the what value.
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting.
+ */
+ public final boolean sendEmptyMessage(int what) {
+ return mExec.sendEmptyMessage(what);
+ }
+
+ /**
+ * Sends a Message containing only the what value, to be delivered
+ * after the specified amount of time elapses.
+ * @see #sendMessageDelayed(Message, long)
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting.
+ */
+ public final boolean sendEmptyMessageDelayed(int what, long delayMillis) {
+ return mExec.sendEmptyMessageDelayed(what, delayMillis);
+ }
+
+ /**
+ * Sends a Message containing only the what value, to be delivered
+ * at a specific time.
+ * @see #sendMessageAtTime(Message, long)
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting.
+ */
+ public final boolean sendEmptyMessageAtTime(int what, long uptimeMillis) {
+ return mExec.sendEmptyMessageAtTime(what, uptimeMillis);
+ }
+
+ /**
+ * Enqueue a message into the message queue after all pending messages
+ * before (current time + delayMillis). You will receive it in
+ * callback, in the thread attached to this handler.
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting. Note that a
+ * result of true does not mean the message will be processed -- if
+ * the looper is quit before the delivery time of the message
+ * occurs then the message will be dropped.
+ */
+ public final boolean sendMessageDelayed(Message msg, long delayMillis) {
+ return mExec.sendMessageDelayed(msg, delayMillis);
+ }
+
+ /**
+ * Enqueue a message into the message queue after all pending messages
+ * before the absolute time (in milliseconds) uptimeMillis.
+ * The time-base is {@link android.os.SystemClock#uptimeMillis}.
+ * You will receive it in callback, in the thread attached
+ * to this handler.
+ *
+ * @param uptimeMillis The absolute time at which the message should be
+ * delivered, using the
+ * {@link android.os.SystemClock#uptimeMillis} time-base.
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting. Note that a
+ * result of true does not mean the message will be processed -- if
+ * the looper is quit before the delivery time of the message
+ * occurs then the message will be dropped.
+ */
+ public boolean sendMessageAtTime(Message msg, long uptimeMillis) {
+ return mExec.sendMessageAtTime(msg, uptimeMillis);
+ }
+
+ /**
+ * Enqueue a message at the front of the message queue, to be processed on
+ * the next iteration of the message loop. You will receive it in
+ * callback, in the thread attached to this handler.
+ * This method is only for use in very special circumstances -- it
+ * can easily starve the message queue, cause ordering problems, or have
+ * other unexpected side-effects.
+ *
+ * @return Returns true if the message was successfully placed in to the
+ * message queue. Returns false on failure, usually because the
+ * looper processing the message queue is exiting.
+ */
+ public final boolean sendMessageAtFrontOfQueue(Message msg) {
+ return mExec.sendMessageAtFrontOfQueue(msg);
+ }
+
+ /**
+ * Remove any pending posts of messages with code 'what' that are in the
+ * message queue.
+ */
+ public final void removeMessages(int what) {
+ mExec.removeMessages(what);
+ }
+
+ /**
+ * Remove any pending posts of messages with code 'what' and whose obj is
+ * 'object' that are in the message queue. If object is null,
+ * all messages will be removed.
+ */
+ public final void removeMessages(int what, Object object) {
+ mExec.removeMessages(what, object);
+ }
+
+ /**
+ * Remove any pending posts of callbacks and sent messages whose
+ * obj is token. If token is null,
+ * all callbacks and messages will be removed.
+ */
+ public final void removeCallbacksAndMessages(Object token) {
+ mExec.removeCallbacksAndMessages(token);
+ }
+
+ /**
+ * Check if there are any pending posts of messages with code 'what' in
+ * the message queue.
+ */
+ public final boolean hasMessages(int what) {
+ return mExec.hasMessages(what);
+ }
+
+ /**
+ * Check if there are any pending posts of messages with code 'what' and
+ * whose obj is 'object' in the message queue.
+ */
+ public final boolean hasMessages(int what, Object object) {
+ return mExec.hasMessages(what, object);
+ }
+
+ public final Looper getLooper() {
+ return mExec.getLooper();
+ }
+
+ private WeakRunnable wrapRunnable(@NonNull Runnable r) {
+ //noinspection ConstantConditions
+ if (r == null) {
+ throw new NullPointerException("Runnable can't be null");
+ }
+ final ChainedRef hardRef = new ChainedRef(mLock, r);
+ mRunnables.insertAfter(hardRef);
+ return hardRef.wrapper;
+ }
+
+ private static class ExecHandler extends Handler {
+ private final WeakReference mCallback;
+
+ ExecHandler() {
+ mCallback = null;
+ }
+
+ ExecHandler(WeakReference callback) {
+ mCallback = callback;
+ }
+
+ ExecHandler(Looper looper) {
+ super(looper);
+ mCallback = null;
+ }
+
+ ExecHandler(Looper looper, WeakReference callback) {
+ super(looper);
+ mCallback = callback;
+ }
+
+ @Override
+ public void handleMessage(@NonNull Message msg) {
+ if (mCallback == null) {
+ return;
+ }
+ final Callback callback = mCallback.get();
+ if (callback == null) { // Already disposed
+ return;
+ }
+ callback.handleMessage(msg);
+ }
+ }
+
+ static class WeakRunnable implements Runnable {
+ private final WeakReference mDelegate;
+ private final WeakReference mReference;
+
+ WeakRunnable(WeakReference delegate, WeakReference reference) {
+ mDelegate = delegate;
+ mReference = reference;
+ }
+
+ @Override
+ public void run() {
+ final Runnable delegate = mDelegate.get();
+ final ChainedRef reference = mReference.get();
+ if (reference != null) {
+ reference.remove();
+ }
+ if (delegate != null) {
+ delegate.run();
+ }
+ }
+ }
+
+ static class ChainedRef {
+ @Nullable
+ ChainedRef next;
+ @Nullable
+ ChainedRef prev;
+ @NonNull
+ final Runnable runnable;
+ @NonNull
+ final WeakRunnable wrapper;
+
+ @NonNull
+ Lock lock;
+
+ public ChainedRef(@NonNull Lock lock, @NonNull Runnable r) {
+ this.runnable = r;
+ this.lock = lock;
+ this.wrapper = new WeakRunnable(new WeakReference<>(r), new WeakReference<>(this));
+ }
+
+ public WeakRunnable remove() {
+ lock.lock();
+ try {
+ if (prev != null) {
+ prev.next = next;
+ }
+ if (next != null) {
+ next.prev = prev;
+ }
+ prev = null;
+ next = null;
+ } finally {
+ lock.unlock();
+ }
+ return wrapper;
+ }
+
+ public void insertAfter(@NonNull ChainedRef candidate) {
+ lock.lock();
+ try {
+ if (this.next != null) {
+ this.next.prev = candidate;
+ }
+
+ candidate.next = this.next;
+ this.next = candidate;
+ candidate.prev = this;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ @Nullable
+ public WeakRunnable remove(Runnable obj) {
+ lock.lock();
+ try {
+ ChainedRef curr = this.next; // Skipping head
+ while (curr != null) {
+ if (curr.runnable == obj) { // We do comparison exactly how Handler does inside
+ return curr.remove();
+ }
+ curr = curr.next;
+ }
+ } finally {
+ lock.unlock();
+ }
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetModel.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetModel.java
index 99ffde3c..473f62e8 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetModel.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetModel.java
@@ -97,7 +97,7 @@ public void initReceiver(Context context) {
public static void showWifiDlg(final Context context) {
AlertDialog.Builder builder = new AlertDialog.Builder(context.getApplicationContext());
if (mWifiDialog == null) {
- mWifiDialog = builder.setIcon(R.drawable.smartbar_home_icon) //
+ mWifiDialog = builder.setIcon(R.drawable.icon_download_new) //
.setTitle("wifi设置") //
.setMessage("当前无网络").setPositiveButton("设置", new DialogInterface
.OnClickListener() {
@@ -138,7 +138,7 @@ public void onClick(DialogInterface dialog, int which) {
public static void showNoNetWorkDlg(final Context context) {
AlertDialog.Builder builder = new AlertDialog.Builder(context.getApplicationContext());
if (mAlertDialog == null) {
- mAlertDialog = builder.setIcon(R.drawable.smartbar_home_icon) //
+ mAlertDialog = builder.setIcon(R.drawable.icon_download_new) //
.setTitle("网络设置") //
.setMessage("当前无网络").setPositiveButton("设置", new DialogInterface
.OnClickListener() {
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetStateUtils.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetStateUtils.java
index 269875e1..ae1c3997 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetStateUtils.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/networkview/NetStateUtils.java
@@ -1,6 +1,7 @@
package com.haier.cellarette.baselibrary.networkview;
import android.Manifest;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.LocationManager;
@@ -68,6 +69,7 @@ public static boolean is2G(Context context) {
/**
* wifi是否打开
*/
+ @SuppressLint("MissingPermission")
public static boolean isWifiEnabled(Context context) {
ConnectivityManager mgrConn = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/ConvertUtil.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/ConvertUtil.java
similarity index 94%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/ConvertUtil.java
rename to commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/ConvertUtil.java
index 37d43798..00752e27 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/ConvertUtil.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/ConvertUtil.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.ratingstarview;
+package com.haier.cellarette.baselibrary.ratingstarview;
import android.text.TextUtils;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/PingfenMainActivity.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/PingfenMainActivity.java
new file mode 100644
index 00000000..655e5049
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/PingfenMainActivity.java
@@ -0,0 +1,22 @@
+package com.haier.cellarette.baselibrary.ratingstarview;
+
+import android.os.Bundle;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.haier.cellarette.baselibrary.R;
+
+// https://github.com/everhad/AndroidRatingStar
+// api 'com.github.everhad:AndroidRatingStar:v1.0.4'
+
+public class PingfenMainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_pingfen);
+
+ RatingStarView rsv_rating = (RatingStarView) findViewById(R.id.rsv_rating);
+ rsv_rating.setRating(1.5f);
+ }
+}
\ No newline at end of file
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/RatingStarView.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/RatingStarView.java
similarity index 99%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/RatingStarView.java
rename to commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/RatingStarView.java
index 3a3a5fab..fc260e00 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/RatingStarView.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/RatingStarView.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.ratingstarview;
+package com.haier.cellarette.baselibrary.ratingstarview;
import android.content.Context;
import android.content.res.TypedArray;
@@ -13,7 +13,7 @@
import android.view.MotionEvent;
import android.view.View;
-import com.example.slbappcomm.R;
+import com.haier.cellarette.baselibrary.R;
import java.util.ArrayList;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/StarModel.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/StarModel.java
similarity index 99%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/StarModel.java
rename to commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/StarModel.java
index 5fe00112..cf01adf8 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/StarModel.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/StarModel.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.ratingstarview;
+package com.haier.cellarette.baselibrary.ratingstarview;
import android.graphics.RectF;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/VertexF.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/VertexF.java
similarity index 80%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/VertexF.java
rename to commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/VertexF.java
index 934ad7a2..72ecb766 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/ratingstarview/VertexF.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/ratingstarview/VertexF.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.ratingstarview;
+package com.haier.cellarette.baselibrary.ratingstarview;
/**
* Created by hxw on 2017-04-23.
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewalluses/demo4baseadpterhelp/hunhe/adapter/BaseRecActDemo41Adapter.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewalluses/demo4baseadpterhelp/hunhe/adapter/BaseRecActDemo41Adapter.java
index 69ed0bc1..0269c7f5 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewalluses/demo4baseadpterhelp/hunhe/adapter/BaseRecActDemo41Adapter.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewalluses/demo4baseadpterhelp/hunhe/adapter/BaseRecActDemo41Adapter.java
@@ -74,7 +74,7 @@ protected void convert(BaseViewHolder helper, BaseRecActDemo41Bean item) {
break;
case BaseRecActDemo41Bean.style4:
final RecyclerView mRecyclerView = helper.getView(R.id.rvlist);
- mRecyclerView.setLayoutManager(new GridLayoutManager(helper.itemView.getContext(), 1, OrientationHelper.HORIZONTAL, false));
+ mRecyclerView.setLayoutManager(new GridLayoutManager(helper.itemView.getContext(), 1, RecyclerView.HORIZONTAL, false));
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setOnFlingListener(null);
mLinearSnapHelper = new LinearSnapHelper();
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6ItemDecoration.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6ItemDecoration.java
index ca0a49e9..0168ce49 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6ItemDecoration.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6ItemDecoration.java
@@ -1,7 +1,7 @@
package com.haier.cellarette.baselibrary.recycleviewmultitype.viewholders.demo6;
import android.graphics.Rect;
-//import android.support.annotation.NonNull;
+//
//import androidx.appcompat.widget.GridLayoutManager.SpanSizeLookup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6footerHorizontalBinder.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6footerHorizontalBinder.java
index 4ae6ce1b..fd77b0e3 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6footerHorizontalBinder.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewmultitype/viewholders/demo6/ItemDemo6footerHorizontalBinder.java
@@ -1,6 +1,6 @@
package com.haier.cellarette.baselibrary.recycleviewmultitype.viewholders.demo6;
-//import android.support.annotation.NonNull;
+//
//import androidx.appcompat.widget.LinearLayoutManager;
//import androidx.appcompat.widget.LinearSnapHelper;
//import androidx.appcompat.widget.OrientationHelper;
@@ -56,7 +56,7 @@ public ViewHolder(View itemView) {
super(itemView);
recyclerView = itemView.findViewById(R.id.list1);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(itemView.getContext());
- linearLayoutManager.setOrientation(OrientationHelper.HORIZONTAL);
+ linearLayoutManager.setOrientation(RecyclerView.HORIZONTAL);
recyclerView.setLayoutManager(linearLayoutManager);
new LinearSnapHelper().attachToRecyclerView(recyclerView);
adapter = new ItemDemo6footerAdapter();
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewutils/JackSnapHelper.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewutils/JackSnapHelper.java
index b991b863..9d6ccdfb 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewutils/JackSnapHelper.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/recycleviewutils/JackSnapHelper.java
@@ -1,7 +1,7 @@
package com.haier.cellarette.baselibrary.recycleviewutils;
-//import android.support.annotation.NonNull;
-//import android.support.annotation.Nullable;
+//
+//
//import androidx.appcompat.widget.LinearLayoutManager;
//import androidx.appcompat.widget.LinearSnapHelper;
//import androidx.appcompat.widget.OrientationHelper;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct.java
new file mode 100644
index 00000000..00180571
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct.java
@@ -0,0 +1,36 @@
+package com.haier.cellarette.baselibrary.scardview;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.haier.cellarette.baselibrary.R;
+
+public class SCardViewAct extends AppCompatActivity {
+ @Override
+ protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_scardview);
+ findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(SCardViewAct.this, SCardViewAct1.class));
+ }
+ });
+ findViewById(R.id.btn2).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(SCardViewAct.this, SCardViewAct2.class));
+ }
+ });
+ findViewById(R.id.btn3).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(SCardViewAct.this, SCardViewAct3.class));
+ }
+ });
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct1.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct1.java
new file mode 100644
index 00000000..d38f8d05
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct1.java
@@ -0,0 +1,19 @@
+package com.haier.cellarette.baselibrary.scardview;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.haier.cellarette.baselibrary.R;
+
+public class SCardViewAct1 extends AppCompatActivity {
+ @Override
+ protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_scardview1);
+
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct2.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct2.java
new file mode 100644
index 00000000..23fd2322
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct2.java
@@ -0,0 +1,19 @@
+package com.haier.cellarette.baselibrary.scardview;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.haier.cellarette.baselibrary.R;
+
+public class SCardViewAct2 extends AppCompatActivity {
+ @Override
+ protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_scardview2);
+
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct3.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct3.java
new file mode 100644
index 00000000..f8a75da7
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scardview/SCardViewAct3.java
@@ -0,0 +1,18 @@
+package com.haier.cellarette.baselibrary.scardview;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.haier.cellarette.baselibrary.R;
+
+public class SCardViewAct3 extends AppCompatActivity {
+ @Override
+ protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_scardview3);
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scrollview/ScrollViewAct.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scrollview/ScrollViewAct.java
index 8f17c8b1..92df893c 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scrollview/ScrollViewAct.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/scrollview/ScrollViewAct.java
@@ -1,7 +1,7 @@
package com.haier.cellarette.baselibrary.scrollview;
import android.os.Bundle;
-//import android.support.annotation.Nullable;
+//
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/shoppingcar/ShoppingCarActivity.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/shoppingcar/ShoppingCarActivity.java
index cae063e6..29a5c854 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/shoppingcar/ShoppingCarActivity.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/shoppingcar/ShoppingCarActivity.java
@@ -1,7 +1,7 @@
package com.haier.cellarette.baselibrary.shoppingcar;
import android.os.Bundle;
-//import android.support.annotation.Nullable;
+//
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/huxiview/BreathingViewHelper.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/shuaxinviewanimation/BreathingViewHelper.java
similarity index 99%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/huxiview/BreathingViewHelper.java
rename to commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/shuaxinviewanimation/BreathingViewHelper.java
index c5844b7d..43412524 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/huxiview/BreathingViewHelper.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/shuaxinviewanimation/BreathingViewHelper.java
@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-package com.example.slbappcomm.huxiview;
+package com.haier.cellarette.baselibrary.shuaxinviewanimation;
import android.graphics.Color;
import android.os.AsyncTask;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/size/SizeUtils.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/size/SizeUtils.java
deleted file mode 100644
index e02d0a04..00000000
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/size/SizeUtils.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package com.haier.cellarette.baselibrary.size;
-
-import android.content.Context;
-import android.util.DisplayMetrics;
-import android.util.TypedValue;
-import android.view.View;
-import android.view.ViewGroup;
-
-/**
- *
- * author: Jeffery.L
- * time : 2016/8/2
- * desc : 尺寸相关工具类
- *
- */
-public final class SizeUtils {
-
- private SizeUtils() {
- throw new UnsupportedOperationException("u can't fuck me...");
- }
-
- /**
- * dp转px
- *
- * @param dpValue dp值
- * @return px值
- */
- public static int dp2px(Context context, float dpValue) {
- final float scale = context.getResources().getDisplayMetrics().density;
- return (int) (dpValue * scale + 0.5f);
- }
-
- /**
- * px转dp
- *
- * @param pxValue px值
- * @return dp值
- */
- public static int px2dp(Context context,float pxValue) {
- final float scale = context.getResources().getDisplayMetrics().density;
- return (int) (pxValue / scale + 0.5f);
- }
-
- /**
- * sp转px
- *
- * @param spValue sp值
- * @return px值
- */
- public static int sp2px(Context context,float spValue) {
- final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
- return (int) (spValue * fontScale + 0.5f);
- }
-
- /**
- * px转sp
- *
- * @param pxValue px值
- * @return sp值
- */
- public static int px2sp(Context context,float pxValue) {
- final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
- return (int) (pxValue / fontScale + 0.5f);
- }
-
- /**
- * 各种单位转换
- * 该方法存在于TypedValue
- *
- * @param unit 单位
- * @param value 值
- * @param metrics DisplayMetrics
- * @return 转换结果
- */
- public static float applyDimension(int unit, float value, DisplayMetrics metrics) {
- switch (unit) {
- case TypedValue.COMPLEX_UNIT_PX:
- return value;
- case TypedValue.COMPLEX_UNIT_DIP:
- return value * metrics.density;
- case TypedValue.COMPLEX_UNIT_SP:
- return value * metrics.scaledDensity;
- case TypedValue.COMPLEX_UNIT_PT:
- return value * metrics.xdpi * (1.0f / 72);
- case TypedValue.COMPLEX_UNIT_IN:
- return value * metrics.xdpi;
- case TypedValue.COMPLEX_UNIT_MM:
- return value * metrics.xdpi * (1.0f / 25.4f);
- }
- return 0;
- }
-
- /**
- * 在onCreate中获取视图的尺寸
- * 需回调onGetSizeListener接口,在onGetSize中获取view宽高
- * 用法示例如下所示
- *
- * SizeUtils.forceGetViewSize(view, new SizeUtils.onGetSizeListener() {
- * Override
- * public void onGetSize(View view) {
- * view.getWidth();
- * }
- * });
- *
- *
- * @param view 视图
- * @param listener 监听器
- */
- public static void forceGetViewSize(final View view, final onGetSizeListener listener) {
- view.post(new Runnable() {
- @Override
- public void run() {
- if (listener != null) {
- listener.onGetSize(view);
- }
- }
- });
- }
-
- /**
- * 获取到View尺寸的监听
- */
- public interface onGetSizeListener {
- void onGetSize(View view);
- }
-
- /**
- * 测量视图尺寸
- *
- * @param view 视图
- * @return arr[0]: 视图宽度, arr[1]: 视图高度
- */
- public static int[] measureView(View view) {
- ViewGroup.LayoutParams lp = view.getLayoutParams();
- if (lp == null) {
- lp = new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- );
- }
- int widthSpec = ViewGroup.getChildMeasureSpec(0, 0, lp.width);
- int lpHeight = lp.height;
- int heightSpec;
- if (lpHeight > 0) {
- heightSpec = View.MeasureSpec.makeMeasureSpec(lpHeight, View.MeasureSpec.EXACTLY);
- } else {
- heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
- }
- view.measure(widthSpec, heightSpec);
- return new int[]{view.getMeasuredWidth(), view.getMeasuredHeight()};
- }
-
- /**
- * 获取测量视图宽度
- *
- * @param view 视图
- * @return 视图宽度
- */
- public static int getMeasuredWidth(View view) {
- return measureView(view)[0];
- }
-
- /**
- * 获取测量视图高度
- *
- * @param view 视图
- * @return 视图高度
- */
- public static int getMeasuredHeight(View view) {
- return measureView(view)[1];
- }
-}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/splash/AlphaView.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/splash/AlphaView.java
index 7f267ce7..f3284071 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/splash/AlphaView.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/splash/AlphaView.java
@@ -2,7 +2,7 @@
import android.content.Context;
import android.content.res.TypedArray;
-//import android.support.annotation.Nullable;
+//
//import androidx.core.view.PagerAdapter;
import androidx.annotation.Nullable;
//import androidx.core.view.ViewPager;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/statusbar/StatusBarUtil.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/statusbar/StatusBarUtil.java
deleted file mode 100644
index defffe8d..00000000
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/statusbar/StatusBarUtil.java
+++ /dev/null
@@ -1,738 +0,0 @@
-package com.haier.cellarette.baselibrary.statusbar;
-
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.content.Context;
-import android.graphics.Color;
-import android.os.Build;
-//import android.support.annotation.ColorInt;
-//import android.support.annotation.IntRange;
-//import android.support.annotation.NonNull;
-//import androidx.coordinatorlayout.widget.CoordinatorLayout;
-//import androidx.core.widget.DrawerLayout;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
-import android.widget.LinearLayout;
-
-import androidx.annotation.ColorInt;
-import androidx.annotation.IntRange;
-import androidx.annotation.NonNull;
-import androidx.coordinatorlayout.widget.CoordinatorLayout;
-import androidx.drawerlayout.widget.DrawerLayout;
-
-import com.haier.cellarette.baselibrary.R;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-/**
- * Created by Jaeger on 16/2/14.
- *
- * Email: chjie.jaeger@gmail.com
- * GitHub: https://github.com/laobie
- */
-public class StatusBarUtil {
-
- public static final int DEFAULT_STATUS_BAR_ALPHA = 112;
- private static final int FAKE_STATUS_BAR_VIEW_ID = R.id.statusbarutil_fake_status_bar_view;
- private static final int FAKE_TRANSLUCENT_VIEW_ID = R.id.statusbarutil_translucent_view;
- private static final int TAG_KEY_HAVE_SET_OFFSET = -123;
-
- /**
- * 设置状态栏颜色
- *
- * @param activity 需要设置的 activity
- * @param color 状态栏颜色值
- */
- public static void setColor(Activity activity, @ColorInt int color) {
- setColor(activity, color, DEFAULT_STATUS_BAR_ALPHA);
- }
-
- /**
- * 设置状态栏颜色
- *
- * @param activity 需要设置的activity
- * @param color 状态栏颜色值
- * @param statusBarAlpha 状态栏透明度
- */
-
- public static void setColor(Activity activity, @ColorInt int color, @IntRange(from = 0, to = 255) int statusBarAlpha) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- activity.getWindow().setStatusBarColor(calculateStatusColor(color, statusBarAlpha));
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
- View fakeStatusBarView = decorView.findViewById(FAKE_STATUS_BAR_VIEW_ID);
- if (fakeStatusBarView != null) {
- if (fakeStatusBarView.getVisibility() == View.GONE) {
- fakeStatusBarView.setVisibility(View.VISIBLE);
- }
- fakeStatusBarView.setBackgroundColor(calculateStatusColor(color, statusBarAlpha));
- } else {
- decorView.addView(createStatusBarView(activity, color, statusBarAlpha));
- }
- setRootView(activity);
- }
- }
-
- /**
- * 为滑动返回界面设置状态栏颜色
- *
- * @param activity 需要设置的activity
- * @param color 状态栏颜色值
- */
- public static void setColorForSwipeBack(Activity activity, int color) {
- setColorForSwipeBack(activity, color, DEFAULT_STATUS_BAR_ALPHA);
- }
-
- /**
- * 为滑动返回界面设置状态栏颜色
- *
- * @param activity 需要设置的activity
- * @param color 状态栏颜色值
- * @param statusBarAlpha 状态栏透明度
- */
- public static void setColorForSwipeBack(Activity activity, @ColorInt int color,
- @IntRange(from = 0, to = 255) int statusBarAlpha) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-
- ViewGroup contentView = activity.findViewById(android.R.id.content);
- View rootView = contentView.getChildAt(0);
- int statusBarHeight = getStatusBarHeight(activity);
- if (rootView != null && rootView instanceof CoordinatorLayout) {
- final CoordinatorLayout coordinatorLayout = (CoordinatorLayout) rootView;
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- coordinatorLayout.setFitsSystemWindows(false);
- contentView.setBackgroundColor(calculateStatusColor(color, statusBarAlpha));
- boolean isNeedRequestLayout = contentView.getPaddingTop() < statusBarHeight;
- if (isNeedRequestLayout) {
- contentView.setPadding(0, statusBarHeight, 0, 0);
- coordinatorLayout.post(new Runnable() {
- @Override
- public void run() {
- coordinatorLayout.requestLayout();
- }
- });
- }
- } else {
- coordinatorLayout.setStatusBarBackgroundColor(calculateStatusColor(color, statusBarAlpha));
- }
- } else {
- contentView.setPadding(0, statusBarHeight, 0, 0);
- contentView.setBackgroundColor(calculateStatusColor(color, statusBarAlpha));
- }
- setTransparentForWindow(activity);
- }
- }
-
- /**
- * 设置状态栏纯色 不加半透明效果
- *
- * @param activity 需要设置的 activity
- * @param color 状态栏颜色值
- */
- public static void setColorNoTranslucent(Activity activity, @ColorInt int color) {
- setColor(activity, color, 0);
- }
-
- /**
- * 设置状态栏颜色(5.0以下无半透明效果,不建议使用)
- *
- * @param activity 需要设置的 activity
- * @param color 状态栏颜色值
- */
- @Deprecated
- public static void setColorDiff(Activity activity, @ColorInt int color) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- transparentStatusBar(activity);
- ViewGroup contentView = activity.findViewById(android.R.id.content);
- // 移除半透明矩形,以免叠加
- View fakeStatusBarView = contentView.findViewById(FAKE_STATUS_BAR_VIEW_ID);
- if (fakeStatusBarView != null) {
- if (fakeStatusBarView.getVisibility() == View.GONE) {
- fakeStatusBarView.setVisibility(View.VISIBLE);
- }
- fakeStatusBarView.setBackgroundColor(color);
- } else {
- contentView.addView(createStatusBarView(activity, color));
- }
- setRootView(activity);
- }
-
- /**
- * 使状态栏半透明
- *
- * 适用于图片作为背景的界面,此时需要图片填充到状态栏
- *
- * @param activity 需要设置的activity
- */
- public static void setTranslucent(Activity activity) {
- setTranslucent(activity, DEFAULT_STATUS_BAR_ALPHA);
- }
-
- /**
- * 使状态栏半透明
- *
- * 适用于图片作为背景的界面,此时需要图片填充到状态栏
- *
- * @param activity 需要设置的activity
- * @param statusBarAlpha 状态栏透明度
- */
- public static void setTranslucent(Activity activity, @IntRange(from = 0, to = 255) int statusBarAlpha) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- setTransparent(activity);
- addTranslucentView(activity, statusBarAlpha);
- }
-
- /**
- * 针对根布局是 CoordinatorLayout, 使状态栏半透明
- *
- * 适用于图片作为背景的界面,此时需要图片填充到状态栏
- *
- * @param activity 需要设置的activity
- * @param statusBarAlpha 状态栏透明度
- */
- public static void setTranslucentForCoordinatorLayout(Activity activity, @IntRange(from = 0, to = 255) int statusBarAlpha) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- transparentStatusBar(activity);
- addTranslucentView(activity, statusBarAlpha);
- }
-
- /**
- * 设置状态栏全透明
- *
- * @param activity 需要设置的activity
- */
- public static void setTransparent(Activity activity) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- transparentStatusBar(activity);
- setRootView(activity);
- }
-
- /**
- * 使状态栏透明(5.0以上半透明效果,不建议使用)
- *
- * 适用于图片作为背景的界面,此时需要图片填充到状态栏
- *
- * @param activity 需要设置的activity
- */
- @Deprecated
- public static void setTranslucentDiff(Activity activity) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- // 设置状态栏透明
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- setRootView(activity);
- }
- }
-
- /**
- * 为DrawerLayout 布局设置状态栏变色
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- * @param color 状态栏颜色值
- */
- public static void setColorForDrawerLayout(Activity activity, DrawerLayout drawerLayout, @ColorInt int color) {
- setColorForDrawerLayout(activity, drawerLayout, color, DEFAULT_STATUS_BAR_ALPHA);
- }
-
- /**
- * 为DrawerLayout 布局设置状态栏颜色,纯色
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- * @param color 状态栏颜色值
- */
- public static void setColorNoTranslucentForDrawerLayout(Activity activity, DrawerLayout drawerLayout, @ColorInt int color) {
- setColorForDrawerLayout(activity, drawerLayout, color, 0);
- }
-
- /**
- * 为DrawerLayout 布局设置状态栏变色
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- * @param color 状态栏颜色值
- * @param statusBarAlpha 状态栏透明度
- */
- public static void setColorForDrawerLayout(Activity activity, DrawerLayout drawerLayout, @ColorInt int color,
- @IntRange(from = 0, to = 255) int statusBarAlpha) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
- } else {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- }
- // 生成一个状态栏大小的矩形
- // 添加 statusBarView 到布局中
- ViewGroup contentLayout = (ViewGroup) drawerLayout.getChildAt(0);
- View fakeStatusBarView = contentLayout.findViewById(FAKE_STATUS_BAR_VIEW_ID);
- if (fakeStatusBarView != null) {
- if (fakeStatusBarView.getVisibility() == View.GONE) {
- fakeStatusBarView.setVisibility(View.VISIBLE);
- }
- fakeStatusBarView.setBackgroundColor(color);
- } else {
- contentLayout.addView(createStatusBarView(activity, color), 0);
- }
- // 内容布局不是 LinearLayout 时,设置padding top
- if (!(contentLayout instanceof LinearLayout) && contentLayout.getChildAt(1) != null) {
- contentLayout.getChildAt(1)
- .setPadding(contentLayout.getPaddingLeft(), getStatusBarHeight(activity) + contentLayout.getPaddingTop(),
- contentLayout.getPaddingRight(), contentLayout.getPaddingBottom());
- }
- // 设置属性
- setDrawerLayoutProperty(drawerLayout, contentLayout);
- addTranslucentView(activity, statusBarAlpha);
- }
-
- /**
- * 设置 DrawerLayout 属性
- *
- * @param drawerLayout DrawerLayout
- * @param drawerLayoutContentLayout DrawerLayout 的内容布局
- */
- private static void setDrawerLayoutProperty(DrawerLayout drawerLayout, ViewGroup drawerLayoutContentLayout) {
- ViewGroup drawer = (ViewGroup) drawerLayout.getChildAt(1);
- drawerLayout.setFitsSystemWindows(false);
- drawerLayoutContentLayout.setFitsSystemWindows(false);
- drawerLayoutContentLayout.setClipToPadding(true);
- drawer.setFitsSystemWindows(false);
- }
-
- /**
- * 为DrawerLayout 布局设置状态栏变色(5.0以下无半透明效果,不建议使用)
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- * @param color 状态栏颜色值
- */
- @Deprecated
- public static void setColorForDrawerLayoutDiff(Activity activity, DrawerLayout drawerLayout, @ColorInt int color) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- // 生成一个状态栏大小的矩形
- ViewGroup contentLayout = (ViewGroup) drawerLayout.getChildAt(0);
- View fakeStatusBarView = contentLayout.findViewById(FAKE_STATUS_BAR_VIEW_ID);
- if (fakeStatusBarView != null) {
- if (fakeStatusBarView.getVisibility() == View.GONE) {
- fakeStatusBarView.setVisibility(View.VISIBLE);
- }
- fakeStatusBarView.setBackgroundColor(calculateStatusColor(color, DEFAULT_STATUS_BAR_ALPHA));
- } else {
- // 添加 statusBarView 到布局中
- contentLayout.addView(createStatusBarView(activity, color), 0);
- }
- // 内容布局不是 LinearLayout 时,设置padding top
- if (!(contentLayout instanceof LinearLayout) && contentLayout.getChildAt(1) != null) {
- contentLayout.getChildAt(1).setPadding(0, getStatusBarHeight(activity), 0, 0);
- }
- // 设置属性
- setDrawerLayoutProperty(drawerLayout, contentLayout);
- }
- }
-
- /**
- * 为 DrawerLayout 布局设置状态栏透明
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- */
- public static void setTranslucentForDrawerLayout(Activity activity, DrawerLayout drawerLayout) {
- setTranslucentForDrawerLayout(activity, drawerLayout, DEFAULT_STATUS_BAR_ALPHA);
- }
-
- /**
- * 为 DrawerLayout 布局设置状态栏透明
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- */
- public static void setTranslucentForDrawerLayout(Activity activity, DrawerLayout drawerLayout,
- @IntRange(from = 0, to = 255) int statusBarAlpha) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- setTransparentForDrawerLayout(activity, drawerLayout);
- addTranslucentView(activity, statusBarAlpha);
- }
-
- /**
- * 为 DrawerLayout 布局设置状态栏透明
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- */
- public static void setTransparentForDrawerLayout(Activity activity, DrawerLayout drawerLayout) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
- } else {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- }
-
- ViewGroup contentLayout = (ViewGroup) drawerLayout.getChildAt(0);
- // 内容布局不是 LinearLayout 时,设置padding top
- if (!(contentLayout instanceof LinearLayout) && contentLayout.getChildAt(1) != null) {
- contentLayout.getChildAt(1).setPadding(0, getStatusBarHeight(activity), 0, 0);
- }
-
- // 设置属性
- setDrawerLayoutProperty(drawerLayout, contentLayout);
- }
-
- /**
- * 为 DrawerLayout 布局设置状态栏透明(5.0以上半透明效果,不建议使用)
- *
- * @param activity 需要设置的activity
- * @param drawerLayout DrawerLayout
- */
- @Deprecated
- public static void setTranslucentForDrawerLayoutDiff(Activity activity, DrawerLayout drawerLayout) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- // 设置状态栏透明
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- // 设置内容布局属性
- ViewGroup contentLayout = (ViewGroup) drawerLayout.getChildAt(0);
- contentLayout.setFitsSystemWindows(true);
- contentLayout.setClipToPadding(true);
- // 设置抽屉布局属性
- ViewGroup vg = (ViewGroup) drawerLayout.getChildAt(1);
- vg.setFitsSystemWindows(false);
- // 设置 DrawerLayout 属性
- drawerLayout.setFitsSystemWindows(false);
- }
- }
-
- /**
- * 为头部是 ImageView 的界面设置状态栏全透明
- *
- * @param activity 需要设置的activity
- * @param needOffsetView 需要向下偏移的 View
- */
- public static void setTransparentForImageView(Activity activity, View needOffsetView) {
- setTranslucentForImageView(activity, 0, needOffsetView);
- }
-
- /**
- * 为头部是 ImageView 的界面设置状态栏透明(使用默认透明度)
- *
- * @param activity 需要设置的activity
- * @param needOffsetView 需要向下偏移的 View
- */
- public static void setTranslucentForImageView(Activity activity, View needOffsetView) {
- setTranslucentForImageView(activity, DEFAULT_STATUS_BAR_ALPHA, needOffsetView);
- }
-
- /**
- * 为头部是 ImageView 的界面设置状态栏透明
- *
- * @param activity 需要设置的activity
- * @param statusBarAlpha 状态栏透明度
- * @param needOffsetView 需要向下偏移的 View
- */
- public static void setTranslucentForImageView(Activity activity, @IntRange(from = 0, to = 255) int statusBarAlpha,
- View needOffsetView) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- return;
- }
- setTransparentForWindow(activity);
- addTranslucentView(activity, statusBarAlpha);
- if (needOffsetView != null) {
- Object haveSetOffset = needOffsetView.getTag(TAG_KEY_HAVE_SET_OFFSET);
- if (haveSetOffset != null && (Boolean) haveSetOffset) {
- return;
- }
- ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) needOffsetView.getLayoutParams();
- layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin + getStatusBarHeight(activity),
- layoutParams.rightMargin, layoutParams.bottomMargin);
- needOffsetView.setTag(TAG_KEY_HAVE_SET_OFFSET, true);
- }
- }
-
- /**
- * 为 fragment 头部是 ImageView 的设置状态栏透明
- *
- * @param activity fragment 对应的 activity
- * @param needOffsetView 需要向下偏移的 View
- */
- public static void setTranslucentForImageViewInFragment(Activity activity, View needOffsetView) {
- setTranslucentForImageViewInFragment(activity, DEFAULT_STATUS_BAR_ALPHA, needOffsetView);
- }
-
- /**
- * 为 fragment 头部是 ImageView 的设置状态栏透明
- *
- * @param activity fragment 对应的 activity
- * @param needOffsetView 需要向下偏移的 View
- */
- public static void setTransparentForImageViewInFragment(Activity activity, View needOffsetView) {
- setTranslucentForImageViewInFragment(activity, 0, needOffsetView);
- }
-
- /**
- * 为 fragment 头部是 ImageView 的设置状态栏透明
- *
- * @param activity fragment 对应的 activity
- * @param statusBarAlpha 状态栏透明度
- * @param needOffsetView 需要向下偏移的 View
- */
- public static void setTranslucentForImageViewInFragment(Activity activity, @IntRange(from = 0, to = 255) int statusBarAlpha,
- View needOffsetView) {
- setTranslucentForImageView(activity, statusBarAlpha, needOffsetView);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- clearPreviousSetting(activity);
- }
- }
-
- /**
- * 隐藏伪状态栏 View
- *
- * @param activity 调用的 Activity
- */
- public static void hideFakeStatusBarView(Activity activity) {
- ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
- View fakeStatusBarView = decorView.findViewById(FAKE_STATUS_BAR_VIEW_ID);
- if (fakeStatusBarView != null) {
- fakeStatusBarView.setVisibility(View.GONE);
- }
- View fakeTranslucentView = decorView.findViewById(FAKE_TRANSLUCENT_VIEW_ID);
- if (fakeTranslucentView != null) {
- fakeTranslucentView.setVisibility(View.GONE);
- }
- }
-
- @TargetApi(Build.VERSION_CODES.M)
- public static void setLightMode(Activity activity) {
- setMIUIStatusBarDarkIcon(activity, true);
- setMeizuStatusBarDarkIcon(activity, true);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
- }
- }
-
- @TargetApi(Build.VERSION_CODES.M)
- public static void setDarkMode(Activity activity) {
- setMIUIStatusBarDarkIcon(activity, false);
- setMeizuStatusBarDarkIcon(activity, false);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
- }
- }
-
- /**
- * 修改 MIUI V6 以上状态栏颜色
- */
- private static void setMIUIStatusBarDarkIcon(@NonNull Activity activity, boolean darkIcon) {
- Class extends Window> clazz = activity.getWindow().getClass();
- try {
- Class> layoutParams = Class.forName("android.view.MiuiWindowManager$LayoutParams");
- Field field = layoutParams.getField("EXTRA_FLAG_STATUS_BAR_DARK_MODE");
- int darkModeFlag = field.getInt(layoutParams);
- Method extraFlagField = clazz.getMethod("setExtraFlags", int.class, int.class);
- extraFlagField.invoke(activity.getWindow(), darkIcon ? darkModeFlag : 0, darkModeFlag);
- } catch (Exception e) {
- //e.printStackTrace();
- }
- }
-
- /**
- * 修改魅族状态栏字体颜色 Flyme 4.0
- */
- private static void setMeizuStatusBarDarkIcon(@NonNull Activity activity, boolean darkIcon) {
- try {
- WindowManager.LayoutParams lp = activity.getWindow().getAttributes();
- Field darkFlag = WindowManager.LayoutParams.class.getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON");
- Field meizuFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags");
- darkFlag.setAccessible(true);
- meizuFlags.setAccessible(true);
- int bit = darkFlag.getInt(null);
- int value = meizuFlags.getInt(lp);
- if (darkIcon) {
- value |= bit;
- } else {
- value &= ~bit;
- }
- meizuFlags.setInt(lp, value);
- activity.getWindow().setAttributes(lp);
- } catch (Exception e) {
- //e.printStackTrace();
- }
- }
-
- ///////////////////////////////////////////////////////////////////////////////////
-
- @TargetApi(Build.VERSION_CODES.KITKAT)
- private static void clearPreviousSetting(Activity activity) {
- ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
- View fakeStatusBarView = decorView.findViewById(FAKE_STATUS_BAR_VIEW_ID);
- if (fakeStatusBarView != null) {
- decorView.removeView(fakeStatusBarView);
- ViewGroup rootView = (ViewGroup) ((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0);
- rootView.setPadding(0, 0, 0, 0);
- }
- }
-
- /**
- * 添加半透明矩形条
- *
- * @param activity 需要设置的 activity
- * @param statusBarAlpha 透明值
- */
- private static void addTranslucentView(Activity activity, @IntRange(from = 0, to = 255) int statusBarAlpha) {
- ViewGroup contentView = activity.findViewById(android.R.id.content);
- View fakeTranslucentView = contentView.findViewById(FAKE_TRANSLUCENT_VIEW_ID);
- if (fakeTranslucentView != null) {
- if (fakeTranslucentView.getVisibility() == View.GONE) {
- fakeTranslucentView.setVisibility(View.VISIBLE);
- }
- fakeTranslucentView.setBackgroundColor(Color.argb(statusBarAlpha, 0, 0, 0));
- } else {
- contentView.addView(createTranslucentStatusBarView(activity, statusBarAlpha));
- }
- }
-
- /**
- * 生成一个和状态栏大小相同的彩色矩形条
- *
- * @param activity 需要设置的 activity
- * @param color 状态栏颜色值
- * @return 状态栏矩形条
- */
- private static View createStatusBarView(Activity activity, @ColorInt int color) {
- return createStatusBarView(activity, color, 0);
- }
-
- /**
- * 生成一个和状态栏大小相同的半透明矩形条
- *
- * @param activity 需要设置的activity
- * @param color 状态栏颜色值
- * @param alpha 透明值
- * @return 状态栏矩形条
- */
- private static View createStatusBarView(Activity activity, @ColorInt int color, int alpha) {
- // 绘制一个和状态栏一样高的矩形
- View statusBarView = new View(activity);
- LinearLayout.LayoutParams params =
- new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(activity));
- statusBarView.setLayoutParams(params);
- statusBarView.setBackgroundColor(calculateStatusColor(color, alpha));
- statusBarView.setId(FAKE_STATUS_BAR_VIEW_ID);
- return statusBarView;
- }
-
- /**
- * 设置根布局参数
- */
- private static void setRootView(Activity activity) {
- ViewGroup parent = activity.findViewById(android.R.id.content);
- for (int i = 0, count = parent.getChildCount(); i < count; i++) {
- View childView = parent.getChildAt(i);
- if (childView instanceof ViewGroup) {
- childView.setFitsSystemWindows(true);
- ((ViewGroup) childView).setClipToPadding(true);
- }
- }
- }
-
- /**
- * 设置透明
- */
- private static void setTransparentForWindow(Activity activity) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
- activity.getWindow()
- .getDecorView()
- .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- activity.getWindow()
- .setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- }
- }
-
- /**
- * 使状态栏透明
- */
- @TargetApi(Build.VERSION_CODES.KITKAT)
- private static void transparentStatusBar(Activity activity) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
- activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
- } else {
- activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- }
- }
-
- /**
- * 创建半透明矩形 View
- *
- * @param alpha 透明值
- * @return 半透明 View
- */
- private static View createTranslucentStatusBarView(Activity activity, int alpha) {
- // 绘制一个和状态栏一样高的矩形
- View statusBarView = new View(activity);
- LinearLayout.LayoutParams params =
- new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(activity));
- statusBarView.setLayoutParams(params);
- statusBarView.setBackgroundColor(Color.argb(alpha, 0, 0, 0));
- statusBarView.setId(FAKE_TRANSLUCENT_VIEW_ID);
- return statusBarView;
- }
-
- /**
- * 获取状态栏高度
- *
- * @param context context
- * @return 状态栏高度
- */
- private static int getStatusBarHeight(Context context) {
- // 获得状态栏高度
- int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
- return context.getResources().getDimensionPixelSize(resourceId);
- }
-
- /**
- * 计算状态栏颜色
- *
- * @param color color值
- * @param alpha alpha值
- * @return 最终的状态栏颜色
- */
- private static int calculateStatusColor(@ColorInt int color, int alpha) {
- if (alpha == 0) {
- return color;
- }
- float a = 1 - alpha / 255f;
- int red = color >> 16 & 0xff;
- int green = color >> 8 & 0xff;
- int blue = color & 0xff;
- red = (int) (red * a + 0.5);
- green = (int) (green * a + 0.5);
- blue = (int) (blue * a + 0.5);
- return 0xff << 24 | red << 16 | green << 8 | blue;
- }
-}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/statusbar/StatusBarUtilV7.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/statusbar/StatusBarUtilV7.java
deleted file mode 100644
index f29cadec..00000000
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/statusbar/StatusBarUtilV7.java
+++ /dev/null
@@ -1,294 +0,0 @@
-package com.haier.cellarette.baselibrary.statusbar;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.res.Resources;
-import android.os.Build;
-//import android.support.annotation.FloatRange;
-//import android.support.annotation.RequiresApi;
-import android.util.Log;
-import android.util.TypedValue;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
-
-import androidx.annotation.FloatRange;
-import androidx.annotation.RequiresApi;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.regex.Pattern;
-
-/**
- * 状态栏透明
- * Created by SCWANG on 2016/10/26.
- */
-
-@SuppressWarnings("unused")
-public class StatusBarUtilV7 {
-
- public static int DEFAULT_COLOR = 0;
- public static float DEFAULT_ALPHA = 0;//Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? 0.2f : 0.3f;
- public static final int MIN_API = 19;
-
- //
- public static void immersive(Activity activity) {
- immersive(activity, DEFAULT_COLOR, DEFAULT_ALPHA);
- }
-
- public static void immersive(Activity activity, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
- immersive(activity.getWindow(), color, alpha);
- }
-
- public static void immersive(Activity activity, int color) {
- immersive(activity.getWindow(), color, 1f);
- }
-
- public static void immersive(Window window) {
- immersive(window, DEFAULT_COLOR, DEFAULT_ALPHA);
- }
-
- public static void immersive(Window window, int color) {
- immersive(window, color, 1f);
- }
-
- public static void immersive(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
- if (Build.VERSION.SDK_INT >= 21) {
- window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- window.setStatusBarColor(mixtureColor(color, alpha));
-
- int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
- systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
- systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
- window.getDecorView().setSystemUiVisibility(systemUiVisibility);
- } else if (Build.VERSION.SDK_INT >= 19) {
- window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- setTranslucentView((ViewGroup) window.getDecorView(), color, alpha);
- } else if (Build.VERSION.SDK_INT >= MIN_API && Build.VERSION.SDK_INT > 16) {
- int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
- systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
- systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
- window.getDecorView().setSystemUiVisibility(systemUiVisibility);
- }
- }
- //
-
- //
- public static void darkMode(Activity activity, boolean dark) {
- if (isFlyme4Later()) {
- darkModeForFlyme4(activity.getWindow(), dark);
- } else if (isMIUI6Later()) {
- darkModeForMIUI6(activity.getWindow(), dark);
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- darkModeForM(activity.getWindow(), dark);
- }
- }
-
- /** 设置状态栏darkMode,字体颜色及icon变黑(目前支持MIUI6以上,Flyme4以上,Android M以上) */
- public static void darkMode(Activity activity) {
- darkMode(activity.getWindow(), DEFAULT_COLOR, DEFAULT_ALPHA);
- }
-
- public static void darkMode(Activity activity, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
- darkMode(activity.getWindow(), color, alpha);
- }
-
- /** 设置状态栏darkMode,字体颜色及icon变黑(目前支持MIUI6以上,Flyme4以上,Android M以上) */
- public static void darkMode(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
- if (isFlyme4Later()) {
- darkModeForFlyme4(window, true);
- immersive(window,color,alpha);
- } else if (isMIUI6Later()) {
- darkModeForMIUI6(window, true);
- immersive(window,color,alpha);
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- darkModeForM(window, true);
- immersive(window, color, alpha);
- } else if (Build.VERSION.SDK_INT >= 19) {
- window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- setTranslucentView((ViewGroup) window.getDecorView(), color, alpha);
- } else {
- immersive(window, color, alpha);
- }
-// if (Build.VERSION.SDK_INT >= 21) {
-// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
-// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
-// window.setStatusBarColor(Color.TRANSPARENT);
-// } else if (Build.VERSION.SDK_INT >= 19) {
-// window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
-// }
-
-// setTranslucentView((ViewGroup) window.getDecorView(), color, alpha);
- }
-
- //------------------------->
-
- /** android 6.0设置字体颜色 */
- @RequiresApi(Build.VERSION_CODES.M)
- private static void darkModeForM(Window window, boolean dark) {
-// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
-// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
-// window.setStatusBarColor(Color.TRANSPARENT);
-
- int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
- if (dark) {
- systemUiVisibility |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
- } else {
- systemUiVisibility &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
- }
- window.getDecorView().setSystemUiVisibility(systemUiVisibility);
- }
-
- /**
- * 设置Flyme4+的darkMode,darkMode时候字体颜色及icon变黑
- * http://open-wiki.flyme.cn/index.php?title=Flyme%E7%B3%BB%E7%BB%9FAPI
- */
- public static boolean darkModeForFlyme4(Window window, boolean dark) {
- boolean result = false;
- if (window != null) {
- try {
- WindowManager.LayoutParams e = window.getAttributes();
- Field darkFlag = WindowManager.LayoutParams.class.getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON");
- Field meizuFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags");
- darkFlag.setAccessible(true);
- meizuFlags.setAccessible(true);
- int bit = darkFlag.getInt(null);
- int value = meizuFlags.getInt(e);
- if (dark) {
- value |= bit;
- } else {
- value &= ~bit;
- }
-
- meizuFlags.setInt(e, value);
- window.setAttributes(e);
- result = true;
- } catch (Exception var8) {
- Log.e("StatusBar", "darkIcon: failed");
- }
- }
-
- return result;
- }
-
- /**
- * 设置MIUI6+的状态栏是否为darkMode,darkMode时候字体颜色及icon变黑
- * http://dev.xiaomi.com/doc/p=4769/
- */
- public static boolean darkModeForMIUI6(Window window, boolean darkmode) {
- Class extends Window> clazz = window.getClass();
- try {
- int darkModeFlag = 0;
- Class> layoutParams = Class.forName("android.view.MiuiWindowManager$LayoutParams");
- Field field = layoutParams.getField("EXTRA_FLAG_STATUS_BAR_DARK_MODE");
- darkModeFlag = field.getInt(layoutParams);
- Method extraFlagField = clazz.getMethod("setExtraFlags", int.class, int.class);
- extraFlagField.invoke(window, darkmode ? darkModeFlag : 0, darkModeFlag);
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- return false;
- }
- }
-
- /** 判断是否Flyme4以上 */
- public static boolean isFlyme4Later() {
- return Build.FINGERPRINT.contains("Flyme_OS_4")
- || Build.VERSION.INCREMENTAL.contains("Flyme_OS_4")
- || Pattern.compile("Flyme OS [4|5]", Pattern.CASE_INSENSITIVE).matcher(Build.DISPLAY).find();
- }
-
- /** 判断是否为MIUI6以上 */
- public static boolean isMIUI6Later() {
- try {
- Class> clz = Class.forName("android.os.SystemProperties");
- Method mtd = clz.getMethod("get", String.class);
- String val = (String) mtd.invoke(null, "ro.miui.ui.version.name");
- val = val.replaceAll("[vV]", "");
- int version = Integer.parseInt(val);
- return version >= 6;
- } catch (Exception e) {
- return false;
- }
- }
- //
-
-
- /** 增加View的paddingTop,增加的值为状态栏高度 */
- public static void setPadding(Context context, View view) {
- if (Build.VERSION.SDK_INT >= MIN_API) {
- view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context),
- view.getPaddingRight(), view.getPaddingBottom());
- }
- }
- /** 增加View的paddingTop,增加的值为状态栏高度 (智能判断,并设置高度)*/
- public static void setPaddingSmart(Context context, View view) {
- if (Build.VERSION.SDK_INT >= MIN_API) {
- ViewGroup.LayoutParams lp = view.getLayoutParams();
- if (lp != null && lp.height > 0) {
- lp.height += getStatusBarHeight(context);//增高
- }
- view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context),
- view.getPaddingRight(), view.getPaddingBottom());
- }
- }
-
- /** 增加View的高度以及paddingTop,增加的值为状态栏高度.一般是在沉浸式全屏给ToolBar用的 */
- public static void setHeightAndPadding(Context context, View view) {
- if (Build.VERSION.SDK_INT >= MIN_API) {
- ViewGroup.LayoutParams lp = view.getLayoutParams();
- lp.height += getStatusBarHeight(context);//增高
- view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context),
- view.getPaddingRight(), view.getPaddingBottom());
- }
- }
- /** 增加View上边距(MarginTop)一般是给高度为 WARP_CONTENT 的小控件用的*/
- public static void setMargin(Context context, View view) {
- if (Build.VERSION.SDK_INT >= MIN_API) {
- ViewGroup.LayoutParams lp = view.getLayoutParams();
- if (lp instanceof ViewGroup.MarginLayoutParams) {
- ((ViewGroup.MarginLayoutParams) lp).topMargin += getStatusBarHeight(context);//增高
- }
- view.setLayoutParams(lp);
- }
- }
- /**
- * 创建假的透明栏
- */
- public static void setTranslucentView(ViewGroup container, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
- if (Build.VERSION.SDK_INT >= 19) {
- int mixtureColor = mixtureColor(color, alpha);
- View translucentView = container.findViewById(android.R.id.custom);
- if (translucentView == null && mixtureColor != 0) {
- translucentView = new View(container.getContext());
- translucentView.setId(android.R.id.custom);
- ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(container.getContext()));
- container.addView(translucentView, lp);
- }
- if (translucentView != null) {
- translucentView.setBackgroundColor(mixtureColor);
- }
- }
- }
-
- public static int mixtureColor(int color, @FloatRange(from = 0.0, to = 1.0) float alpha) {
- int a = (color & 0xff000000) == 0 ? 0xff : color >>> 24;
- return (color & 0x00ffffff) | (((int) (a * alpha)) << 24);
- }
-
- /** 获取状态栏高度 */
- public static int getStatusBarHeight(Context context) {
- int result = 24;
- int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
- if (resId > 0) {
- result = context.getResources().getDimensionPixelSize(resId);
- } else {
- result = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
- result, Resources.getSystem().getDisplayMetrics());
- }
- return result;
- }
-}
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/tablayout/UnAnimTabLayout.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/tablayout/UnAnimTabLayout.java
index d93f372c..fd9c6bf7 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/tablayout/UnAnimTabLayout.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/tablayout/UnAnimTabLayout.java
@@ -1,7 +1,7 @@
package com.haier.cellarette.baselibrary.tablayout;
import android.content.Context;
-//import android.support.annotation.NonNull;
+//
//import android.support.design.widget.TabLayout;
import android.util.AttributeSet;
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/usersdk/LoginUtil.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/usersdk/LoginUtil.java
deleted file mode 100644
index e0b3dd9f..00000000
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/usersdk/LoginUtil.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.haier.cellarette.baselibrary.usersdk;
-
-import android.app.Activity;
-import android.content.Intent;
-
-/**
- * Created by shining on 2017/11/8.
- */
-
-public class LoginUtil {
-
- public static final int LOGIN_REQUEST_CODE = 301;
- public static final int LOGINOUT_REQUEST_CODE = 302;
- public static final int LOGIN_RESULT_OK = 101;
- public static final int LOGIN_RESULT_CANCELED = 102;
- public static final int LOGINOUT_RESULT_OK = 201;
- public static final int LOGINOUT_RESULT_CANCELED = 202;
-
- private static LoginUtil sInstance;
- private static final Object lock = new Object();
- private Runnable mLastRunnnable;
-
-
- public LoginUtil() {
- }
-
- public static LoginUtil get() {
- if (sInstance == null) {
- synchronized (lock) {
- sInstance = new LoginUtil();
- }
- }
- return sInstance;
- }
-
- /**
- * 用户是否登录
- *
- * @return
- */
- public static boolean isUserLogin() {
- // step 1 判断内存中是否有user_id
-// if (!TextUtils.isEmpty(DataProvider.getUser_id())) {
-// return true;
-// }
-// // step 2 如果内存中没有, 则去文件中找
-// String uid = (String) SpUtils.get(get()).get(ConstantUtil.USER_ID, null);
-// // step 3 如果文件中有, 则提到内存中
-// if (!TextUtils.isEmpty(uid)) {
-// DataProvider.setUser_id(uid);
-// return true;
-// }
- // 未登录
- return false;
- }
-
-
-
- public void loginTowhere(Activity activity, Runnable runnable) {
- if (isUserLogin()) {
- if (runnable != null) {
- runnable.run();
- }
- }
- mLastRunnnable = runnable;
- login(activity);
- }
-
- public void login(Activity activity) {
- Intent intent = new Intent("hs.act.loginactivity");
- if (intent.resolveActivity(activity.getPackageManager()) != null) {
- activity.startActivityForResult(intent, LOGIN_REQUEST_CODE);
- }
- }
-
- public void loginOutTowhere(Activity activity, Runnable runnable) {
- if (isUserLogin()) {
- if (runnable == null) {
- runnable.run();
- }
- }
- mLastRunnnable = runnable;
- loginOut(activity);
- }
-
- public void loginOut(Activity activity) {
- Intent intent = new Intent("hs.act.loginoutactivity");
- if (intent.resolveActivity(activity.getPackageManager()) != null) {
- activity.startActivityForResult(intent, LOGINOUT_REQUEST_CODE);
- }
- }
-
- public boolean login_activity_result(int requestCode, int resultCode, Intent data) {
- Runnable runnable = mLastRunnnable;
- mLastRunnnable = null;
- //已登录
- if (requestCode == LOGIN_REQUEST_CODE) {
- if (resultCode == LOGIN_RESULT_OK && runnable != null) {
- runnable.run();
- }
- return true;
- }
- //未登录
- if (requestCode == LOGINOUT_REQUEST_CODE) {
- if (resultCode == LOGINOUT_RESULT_OK && runnable != null) {
- runnable.run();
- }
- return true;
- }
-
- return false;
- }
-
-}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/widget/SwitchButton.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/widget/SwitchButton.java
index 96dba82c..0a433d95 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/widget/SwitchButton.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/widget/SwitchButton.java
@@ -22,6 +22,7 @@
/**
* 自义定开关按钮
+ * https://github.com/kyleduo/SwitchButton
*/
public class SwitchButton extends View implements Checkable {
private static final int DEFAULT_WIDTH = dp2pxInt(58);
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/zothers/SpannableStringUtils.java b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/zothers/SpannableStringUtils.java
index de6cd0b6..1616c3fd 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/zothers/SpannableStringUtils.java
+++ b/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/zothers/SpannableStringUtils.java
@@ -39,8 +39,8 @@
//import android.support.annotation.ColorInt;
//import android.support.annotation.DrawableRes;
-//import android.support.annotation.NonNull;
-//import android.support.annotation.Nullable;
+//
+//
/**
*
diff --git a/commonlibs/baselibrary/src/main/res/drawable/bg_large_oval_radius.xml b/commonlibs/baselibrary/src/main/res/drawable/bg_large_oval_radius.xml
new file mode 100644
index 00000000..817dafad
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/drawable/bg_large_oval_radius.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/drawable/bg_oval_radius.xml b/commonlibs/baselibrary/src/main/res/drawable/bg_oval_radius.xml
new file mode 100644
index 00000000..549e684a
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/drawable/bg_oval_radius.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/drawable/ed_bg.xml b/commonlibs/baselibrary/src/main/res/drawable/ed_bg.xml
new file mode 100644
index 00000000..e26708fd
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/drawable/ed_bg.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_bigimageviewpager.xml b/commonlibs/baselibrary/src/main/res/layout/activity_bigimageviewpager.xml
new file mode 100644
index 00000000..8360455f
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_bigimageviewpager.xml
@@ -0,0 +1,296 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_expandabletextview.xml b/commonlibs/baselibrary/src/main/res/layout/activity_expandabletextview.xml
new file mode 100644
index 00000000..6d81bfdc
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_expandabletextview.xml
@@ -0,0 +1,393 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_marqueeviewlibrary.xml b/commonlibs/baselibrary/src/main/res/layout/activity_marqueeviewlibrary.xml
new file mode 100644
index 00000000..21985f75
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_marqueeviewlibrary.xml
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_network_loading.xml b/commonlibs/baselibrary/src/main/res/layout/activity_network_loading1.xml
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/layout/activity_network_loading.xml
rename to commonlibs/baselibrary/src/main/res/layout/activity_network_loading1.xml
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_pingfen.xml b/commonlibs/baselibrary/src/main/res/layout/activity_pingfen.xml
new file mode 100644
index 00000000..9043a83a
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_pingfen.xml
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/res/layout/activity_shareindex1.xml b/commonlibs/baselibrary/src/main/res/layout/activity_scardview.xml
similarity index 53%
rename from commonlibs/hunheku/libappjpushshare/src/main/res/layout/activity_shareindex1.xml
rename to commonlibs/baselibrary/src/main/res/layout/activity_scardview.xml
index db2b1ff2..6dc34a22 100644
--- a/commonlibs/hunheku/libappjpushshare/src/main/res/layout/activity_shareindex1.xml
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_scardview.xml
@@ -2,28 +2,34 @@
+ android:text="阴影方向" />
+ android:text="边角可见性" />
+ android:text="官方cardview" />
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_scardview1.xml b/commonlibs/baselibrary/src/main/res/layout/activity_scardview1.xml
new file mode 100644
index 00000000..f6787558
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_scardview1.xml
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_scardview2.xml b/commonlibs/baselibrary/src/main/res/layout/activity_scardview2.xml
new file mode 100644
index 00000000..5a493c59
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_scardview2.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_scardview3.xml b/commonlibs/baselibrary/src/main/res/layout/activity_scardview3.xml
new file mode 100644
index 00000000..27edb428
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_scardview3.xml
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/activity_show_in_recycler_view.xml b/commonlibs/baselibrary/src/main/res/layout/activity_show_in_recycler_view.xml
new file mode 100644
index 00000000..14f9df05
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/activity_show_in_recycler_view.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
diff --git a/commonlibs/baselibrary/src/main/res/layout/complex_view.xml b/commonlibs/baselibrary/src/main/res/layout/complex_view.xml
new file mode 100644
index 00000000..0d9a194c
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/complex_view.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/dialog_input.xml b/commonlibs/baselibrary/src/main/res/layout/dialog_input.xml
new file mode 100644
index 00000000..9fb74162
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/dialog_input.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/empty_error.xml b/commonlibs/baselibrary/src/main/res/layout/empty_error1.xml
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/layout/empty_error.xml
rename to commonlibs/baselibrary/src/main/res/layout/empty_error1.xml
diff --git a/commonlibs/baselibrary/src/main/res/layout/empty_loading.xml b/commonlibs/baselibrary/src/main/res/layout/empty_loading1.xml
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/layout/empty_loading.xml
rename to commonlibs/baselibrary/src/main/res/layout/empty_loading1.xml
diff --git a/commonlibs/baselibrary/src/main/res/layout/empty_nodata.xml b/commonlibs/baselibrary/src/main/res/layout/empty_nodata1.xml
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/layout/empty_nodata.xml
rename to commonlibs/baselibrary/src/main/res/layout/empty_nodata1.xml
diff --git a/commonlibs/baselibrary/src/main/res/layout/empty_view_demo.xml b/commonlibs/baselibrary/src/main/res/layout/empty_view_demo.xml
index a93ac4b5..29e54917 100644
--- a/commonlibs/baselibrary/src/main/res/layout/empty_view_demo.xml
+++ b/commonlibs/baselibrary/src/main/res/layout/empty_view_demo.xml
@@ -7,8 +7,8 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"
- app:errornet_layout="@layout/empty_error"
- app:loading_layout="@layout/empty_loading"
- app:nodata_layout="@layout/empty_nodata"
- app:unreachable_layout="@layout/empty_nodata"
+ app:errornet_layout="@layout/empty_error1"
+ app:loading_layout="@layout/empty_loading1"
+ app:nodata_layout="@layout/empty_nodata1"
+ app:unreachable_layout="@layout/empty_nodata1"
tools:visibility="visible" />
diff --git a/commonlibs/baselibrary/src/main/res/layout/image_progress_layout_theme_1.xml b/commonlibs/baselibrary/src/main/res/layout/image_progress_layout_theme_1.xml
new file mode 100644
index 00000000..961a2ebd
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/image_progress_layout_theme_1.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/layout/item_text.xml b/commonlibs/baselibrary/src/main/res/layout/item_text.xml
new file mode 100644
index 00000000..fd4390c4
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/layout/item_text.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/menu/menu_layout.xml b/commonlibs/baselibrary/src/main/res/menu/menu_layout.xml
new file mode 100644
index 00000000..14636872
--- /dev/null
+++ b/commonlibs/baselibrary/src/main/res/menu/menu_layout.xml
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/commonlibs/baselibrary/src/main/res/mipmap-hdpi/gray.png b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/gray.png
new file mode 100644
index 00000000..aaa31c2e
Binary files /dev/null and b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/gray.png differ
diff --git a/commonlibs/baselibrary/src/main/res/mipmap-hdpi/green.png b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/green.png
new file mode 100644
index 00000000..a684bcc0
Binary files /dev/null and b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/green.png differ
diff --git a/commonlibs/baselibrary/src/main/res/mipmap-hdpi/icon.png b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/icon.png
new file mode 100644
index 00000000..046a286f
Binary files /dev/null and b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/icon.png differ
diff --git a/commonlibs/baselibrary/src/main/res/mipmap-hdpi/logo.png b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/logo.png
new file mode 100644
index 00000000..3c766e57
Binary files /dev/null and b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/logo.png differ
diff --git a/commonlibs/baselibrary/src/main/res/mipmap-hdpi/piliang.png b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/piliang.png
new file mode 100644
index 00000000..dd10351e
Binary files /dev/null and b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/piliang.png differ
diff --git a/commonlibs/baselibrary/src/main/res/mipmap-hdpi/right.png b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/right.png
new file mode 100644
index 00000000..ab75cc3e
Binary files /dev/null and b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/right.png differ
diff --git a/commonlibs/baselibrary/src/main/res/mipmap-hdpi/speaker.png b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/speaker.png
new file mode 100644
index 00000000..96a754c3
Binary files /dev/null and b/commonlibs/baselibrary/src/main/res/mipmap-hdpi/speaker.png differ
diff --git a/commonlibs/baselibrary/src/main/res/values/attrs.xml b/commonlibs/baselibrary/src/main/res/values/attrs.xml
index 31055071..f2e6dc21 100644
--- a/commonlibs/baselibrary/src/main/res/values/attrs.xml
+++ b/commonlibs/baselibrary/src/main/res/values/attrs.xml
@@ -40,12 +40,6 @@
-
-
-
-
-
-
@@ -366,6 +360,21 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/hunheku/libagentweb-core/.gitignore b/commonlibs/common/libagentweb-core/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/.gitignore
rename to commonlibs/common/libagentweb-core/.gitignore
diff --git a/commonlibs/hunheku/libagentweb-core/build.gradle b/commonlibs/common/libagentweb-core/build.gradle
similarity index 69%
rename from commonlibs/hunheku/libagentweb-core/build.gradle
rename to commonlibs/common/libagentweb-core/build.gradle
index 06baf2a7..07bc7b9f 100644
--- a/commonlibs/hunheku/libagentweb-core/build.gradle
+++ b/commonlibs/common/libagentweb-core/build.gradle
@@ -6,11 +6,10 @@ def config = rootProject.ext //配置
def librarys = rootProject.ext.dependencies //
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
-// implementation 'com.download.library:Downloader:4.1.2'
implementation 'com.github.Justson:Downloader:v4.1.9'
- implementation project(':commonlibs:hunheku:libutils')
-// implementation 'com.coolindicator.sdk:coolindicator:1.0.0-beta'
+ implementation project(':commonlibs:common:libutils')
// implementation (name: 'alipaysdk-15.8.01.210112203525', ext: 'aar')
implementation project(path: ':libsCenterNew:alipaysdk')
+
}
diff --git a/commonlibs/hunheku/libagentweb-core/proguard-rules.pro b/commonlibs/common/libagentweb-core/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/proguard-rules.pro
rename to commonlibs/common/libagentweb-core/proguard-rules.pro
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/AndroidManifest.xml b/commonlibs/common/libagentweb-core/src/main/AndroidManifest.xml
similarity index 99%
rename from commonlibs/hunheku/libagentweb-core/src/main/AndroidManifest.xml
rename to commonlibs/common/libagentweb-core/src/main/AndroidManifest.xml
index b15bac56..124592e4 100644
--- a/commonlibs/hunheku/libagentweb-core/src/main/AndroidManifest.xml
+++ b/commonlibs/common/libagentweb-core/src/main/AndroidManifest.xml
@@ -14,7 +14,6 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/web_files_public" />
-
= Build.VERSION_CODES.M) {
+ rationale = shouldShowRequestPermissionRationale(permission);
+ }
if (rationale) {
break;
}
@@ -161,7 +164,9 @@ private void permission(Action action) {
return;
}
if (mPermissionListener != null){
- requestPermissions(permissions.toArray(new String[]{}), 1);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ requestPermissions(permissions.toArray(new String[]{}), 1);
+ }
}
}
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWeb.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWeb.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWeb.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWeb.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebConfig.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebConfig.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebConfig.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebConfig.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebFileProvider.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebFileProvider.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebFileProvider.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebFileProvider.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebJsInterfaceCompat.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebJsInterfaceCompat.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebJsInterfaceCompat.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebJsInterfaceCompat.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebPermissions.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebPermissions.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebPermissions.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebPermissions.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebSettingsImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebSettingsImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebSettingsImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebSettingsImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUIControllerImplBase.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUIControllerImplBase.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUIControllerImplBase.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUIControllerImplBase.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUtils.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUtils.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUtils.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebUtils.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebView.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebView.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/AgentWebView.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/AgentWebView.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorSpec.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorSpec.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorSpec.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorSpec.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorView.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorView.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorView.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/BaseIndicatorView.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/BaseJsAccessEntrace.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/BaseJsAccessEntrace.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/BaseJsAccessEntrace.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/BaseJsAccessEntrace.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultChromeClient.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultChromeClient.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultChromeClient.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultChromeClient.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultDesignUIController.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultDesignUIController.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultDesignUIController.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultDesignUIController.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultDownloadImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultDownloadImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultDownloadImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultDownloadImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultUIController.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultUIController.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultUIController.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultUIController.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebClient.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebClient.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebClient.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebClient.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebCreator.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebCreator.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebCreator.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebCreator.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebLifeCycleImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebLifeCycleImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebLifeCycleImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/DefaultWebLifeCycleImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/EventHandlerImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/EventHandlerImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/EventHandlerImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/EventHandlerImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/EventInterceptor.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/EventInterceptor.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/EventInterceptor.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/EventInterceptor.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/HookManager.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/HookManager.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/HookManager.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/HookManager.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/HttpHeaders.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/HttpHeaders.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/HttpHeaders.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/HttpHeaders.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IAgentWebSettings.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IAgentWebSettings.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IAgentWebSettings.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IAgentWebSettings.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IEventHandler.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IEventHandler.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IEventHandler.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IEventHandler.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IUrlLoader.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IUrlLoader.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IUrlLoader.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IUrlLoader.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IVideo.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IVideo.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IVideo.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IVideo.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IWebIndicator.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IWebIndicator.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IWebIndicator.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IWebIndicator.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IWebLayout.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IWebLayout.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IWebLayout.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IWebLayout.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IndicatorController.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IndicatorController.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IndicatorController.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IndicatorController.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IndicatorHandler.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IndicatorHandler.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/IndicatorHandler.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/IndicatorHandler.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntrace.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntrace.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntrace.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntrace.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntraceImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntraceImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntraceImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsAccessEntraceImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsBaseInterfaceHolder.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsBaseInterfaceHolder.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsBaseInterfaceHolder.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsBaseInterfaceHolder.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsCallJava.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsCallJava.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsCallJava.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsCallJava.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsCallback.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsCallback.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsCallback.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsCallback.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolder.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolder.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolder.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolder.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolderImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolderImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolderImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolderImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceObjectException.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceObjectException.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceObjectException.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/JsInterfaceObjectException.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/LayoutParamsOffer.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/LayoutParamsOffer.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/LayoutParamsOffer.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/LayoutParamsOffer.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/LogUtils.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/LogUtils.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/LogUtils.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/LogUtils.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/LollipopFixedWebView.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/LollipopFixedWebView.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/LollipopFixedWebView.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/LollipopFixedWebView.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebChromeBase.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebChromeBase.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebChromeBase.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebChromeBase.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebClientBase.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebClientBase.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebClientBase.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/MiddlewareWebClientBase.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/NestedScrollAgentWebView.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/NestedScrollAgentWebView.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/NestedScrollAgentWebView.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/NestedScrollAgentWebView.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/PermissionInterceptor.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/PermissionInterceptor.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/PermissionInterceptor.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/PermissionInterceptor.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/ProcessUtils.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/ProcessUtils.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/ProcessUtils.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/ProcessUtils.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/Provider.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/Provider.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/Provider.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/Provider.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/QuickCallJs.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/QuickCallJs.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/QuickCallJs.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/QuickCallJs.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/UrlCommonException.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/UrlCommonException.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/UrlCommonException.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/UrlCommonException.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/UrlLoaderImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/UrlLoaderImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/UrlLoaderImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/UrlLoaderImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/VideoImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/VideoImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/VideoImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/VideoImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClient.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClient.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClient.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClient.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClientDelegate.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClientDelegate.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClientDelegate.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebChromeClientDelegate.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebCreator.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebCreator.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebCreator.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebCreator.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebIndicator.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebIndicator.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebIndicator.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebIndicator.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebLifeCycle.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebLifeCycle.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebLifeCycle.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebLifeCycle.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebListenerManager.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebListenerManager.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebListenerManager.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebListenerManager.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebParentLayout.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebParentLayout.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebParentLayout.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebParentLayout.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityCheckLogic.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityCheckLogic.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityCheckLogic.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityCheckLogic.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityController.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityController.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityController.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityController.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityControllerImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityControllerImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityControllerImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityControllerImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityLogicImpl.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityLogicImpl.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityLogicImpl.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebSecurityLogicImpl.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebViewClient.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebViewClient.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebViewClient.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebViewClient.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebViewClientDelegate.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebViewClientDelegate.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/WebViewClientDelegate.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/WebViewClientDelegate.java
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebActivity.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebActivity.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebActivity.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebActivity.java
index 8ed2e715..49e43716 100644
--- a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebActivity.java
+++ b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebActivity.java
@@ -16,7 +16,6 @@
import androidx.appcompat.app.AppCompatActivity;
import com.blankj.utilcode.util.LogUtils;
-import com.just.agentweb.R;
import com.just.agentweb.AgentWeb;
import com.just.agentweb.AgentWebConfig;
import com.just.agentweb.AgentWebSettingsImpl;
@@ -27,6 +26,7 @@
import com.just.agentweb.MiddlewareWebChromeBase;
import com.just.agentweb.MiddlewareWebClientBase;
import com.just.agentweb.PermissionInterceptor;
+import com.just.agentweb.R;
import com.just.agentweb.WebChromeClient;
import com.just.agentweb.WebViewClient;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/news/BaseAgentWebFragment.java b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebFragment.java
similarity index 99%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/news/BaseAgentWebFragment.java
rename to commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebFragment.java
index 2734e81f..ecbd643f 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/news/BaseAgentWebFragment.java
+++ b/commonlibs/common/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebFragment.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.base.news;
+package com.just.agentweb.base;
import android.content.Intent;
import android.os.Bundle;
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/drawable/default_drawable_indicator.xml b/commonlibs/common/libagentweb-core/src/main/res/drawable/default_drawable_indicator.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/drawable/default_drawable_indicator.xml
rename to commonlibs/common/libagentweb-core/src/main/res/drawable/default_drawable_indicator.xml
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/drawable/ic_back.png b/commonlibs/common/libagentweb-core/src/main/res/drawable/ic_back.png
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/drawable/ic_back.png
rename to commonlibs/common/libagentweb-core/src/main/res/drawable/ic_back.png
diff --git a/commonlibs/common/libagentweb-core/src/main/res/drawable/indicator_blue_bg2.xml b/commonlibs/common/libagentweb-core/src/main/res/drawable/indicator_blue_bg2.xml
new file mode 100644
index 00000000..02e17fac
--- /dev/null
+++ b/commonlibs/common/libagentweb-core/src/main/res/drawable/indicator_blue_bg2.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/layout/agentweb_error_page.xml b/commonlibs/common/libagentweb-core/src/main/res/layout/agentweb_error_page.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/layout/agentweb_error_page.xml
rename to commonlibs/common/libagentweb-core/src/main/res/layout/agentweb_error_page.xml
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/values-zh/strings.xml b/commonlibs/common/libagentweb-core/src/main/res/values-zh/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/values-zh/strings.xml
rename to commonlibs/common/libagentweb-core/src/main/res/values-zh/strings.xml
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/values/attrs.xml b/commonlibs/common/libagentweb-core/src/main/res/values/attrs.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/values/attrs.xml
rename to commonlibs/common/libagentweb-core/src/main/res/values/attrs.xml
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/values/colors.xml b/commonlibs/common/libagentweb-core/src/main/res/values/colors.xml
similarity index 99%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/values/colors.xml
rename to commonlibs/common/libagentweb-core/src/main/res/values/colors.xml
index 7000a47f..a595edfc 100644
--- a/commonlibs/hunheku/libagentweb-core/src/main/res/values/colors.xml
+++ b/commonlibs/common/libagentweb-core/src/main/res/values/colors.xml
@@ -7,4 +7,6 @@
#FB6215
#f75acb
#1ae8ff
+
+
\ No newline at end of file
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/values/ids.xml b/commonlibs/common/libagentweb-core/src/main/res/values/ids.xml
similarity index 99%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/values/ids.xml
rename to commonlibs/common/libagentweb-core/src/main/res/values/ids.xml
index d473a79d..2441540e 100644
--- a/commonlibs/hunheku/libagentweb-core/src/main/res/values/ids.xml
+++ b/commonlibs/common/libagentweb-core/src/main/res/values/ids.xml
@@ -4,4 +4,5 @@
+
\ No newline at end of file
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/values/strings.xml b/commonlibs/common/libagentweb-core/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/values/strings.xml
rename to commonlibs/common/libagentweb-core/src/main/res/values/strings.xml
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/values/style.xml b/commonlibs/common/libagentweb-core/src/main/res/values/style.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/values/style.xml
rename to commonlibs/common/libagentweb-core/src/main/res/values/style.xml
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/res/xml/web_files_public.xml b/commonlibs/common/libagentweb-core/src/main/res/xml/web_files_public.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-core/src/main/res/xml/web_files_public.xml
rename to commonlibs/common/libagentweb-core/src/main/res/xml/web_files_public.xml
diff --git a/commonlibs/hunheku/libagentweb-filechooser/.gitignore b/commonlibs/common/libagentweb-filechooser/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libagentweb-filechooser/.gitignore
rename to commonlibs/common/libagentweb-filechooser/.gitignore
diff --git a/commonlibs/hunheku/libagentweb-filechooser/build.gradle b/commonlibs/common/libagentweb-filechooser/build.gradle
similarity index 80%
rename from commonlibs/hunheku/libagentweb-filechooser/build.gradle
rename to commonlibs/common/libagentweb-filechooser/build.gradle
index c45000f7..595b3c8f 100644
--- a/commonlibs/hunheku/libagentweb-filechooser/build.gradle
+++ b/commonlibs/common/libagentweb-filechooser/build.gradle
@@ -7,5 +7,5 @@ def config = rootProject.ext //配置
def librarys = rootProject.ext.dependencies //
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
- implementation project(':commonlibs:hunheku:libagentweb-core')
+ implementation project(':commonlibs:common:libagentweb-core')
}
diff --git a/commonlibs/hunheku/libagentweb-filechooser/proguard-rules.pro b/commonlibs/common/libagentweb-filechooser/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/libagentweb-filechooser/proguard-rules.pro
rename to commonlibs/common/libagentweb-filechooser/proguard-rules.pro
diff --git a/commonlibs/hunheku/libagentweb-filechooser/src/main/AndroidManifest.xml b/commonlibs/common/libagentweb-filechooser/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-filechooser/src/main/AndroidManifest.xml
rename to commonlibs/common/libagentweb-filechooser/src/main/AndroidManifest.xml
diff --git a/commonlibs/hunheku/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileChooser.java b/commonlibs/common/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileChooser.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileChooser.java
rename to commonlibs/common/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileChooser.java
diff --git a/commonlibs/hunheku/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileParcel.java b/commonlibs/common/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileParcel.java
similarity index 100%
rename from commonlibs/hunheku/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileParcel.java
rename to commonlibs/common/libagentweb-filechooser/src/main/java/com/just/agentweb/filechooser/FileParcel.java
diff --git a/commonlibs/hunheku/libagentweb-filechooser/src/main/res/values/strings.xml b/commonlibs/common/libagentweb-filechooser/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libagentweb-filechooser/src/main/res/values/strings.xml
rename to commonlibs/common/libagentweb-filechooser/src/main/res/values/strings.xml
diff --git a/commonlibs/common/libbase/.gitignore b/commonlibs/common/libbase/.gitignore
new file mode 100644
index 00000000..42afabfd
--- /dev/null
+++ b/commonlibs/common/libbase/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/commonlibs/common/libbase/build.gradle b/commonlibs/common/libbase/build.gradle
new file mode 100644
index 00000000..7a664fb2
--- /dev/null
+++ b/commonlibs/common/libbase/build.gradle
@@ -0,0 +1,25 @@
+plugins {
+ id 'com.android.library'
+}
+apply from: './../../../commonlibs1.gradle'
+def librarys = rootProject.ext.dependencies //
+dependencies {
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ // 必须依赖
+ implementation project(':commonlibs:common:libutils')
+ api project(':commonlibs:common:libswipebacklayout')
+ // 挑选依赖
+ api project(':commonlibs:common:libagentweb-core')
+ api project(':commonlibs:common:libagentweb-filechooser')
+ api project(':commonlibs:common:libwebview')
+ api librarys.glide47
+ api project(':commonlibs:common:libglide47')
+ api project(':commonlibs:common:librararyforfileprovdider')
+// https://github.com/CymChad/BaseRecyclerViewAdapterHelper
+ api 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.40'
+// https://github.com/scwang90/SmartRefreshLayout
+ api project(':commonlibs:smartrefreshlayout:refresh-footer')
+ api project(':commonlibs:smartrefreshlayout:refresh-header')
+ api project(':commonlibs:smartrefreshlayout:refresh-layout')
+
+}
\ No newline at end of file
diff --git a/commonlibs/yewulibs/slbswipebacklayout/consumer-rules.pro b/commonlibs/common/libbase/consumer-rules.pro
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/consumer-rules.pro
rename to commonlibs/common/libbase/consumer-rules.pro
diff --git a/commonlibs/common/libbase/proguard-rules.pro b/commonlibs/common/libbase/proguard-rules.pro
new file mode 100644
index 00000000..481bb434
--- /dev/null
+++ b/commonlibs/common/libbase/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/AndroidManifest.xml b/commonlibs/common/libbase/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..186e0385
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/AndroidManifest.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/ActDemo.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/ActDemo.java
new file mode 100644
index 00000000..d4a9bffa
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/ActDemo.java
@@ -0,0 +1,7 @@
+package com.example.libbase;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+public class ActDemo extends AppCompatActivity {
+
+}
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/BaseActWebActivity.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BaseActWebActivity.java
similarity index 94%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/BaseActWebActivity.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BaseActWebActivity.java
index 742290cb..01cb84aa 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/BaseActWebActivity.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BaseActWebActivity.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.base;
+package com.example.libbase.agentwebview.activity;
import android.app.Activity;
import android.os.Bundle;
@@ -10,9 +10,9 @@
import androidx.annotation.Nullable;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.news.BaseAgentWebActivity;
+import com.example.libbase.R;
import com.geek.libutils.app.BaseAppManager;
+import com.just.agentweb.base.BaseAgentWebActivity;
public abstract class BaseActWebActivity extends BaseAgentWebActivity {
public Activity activity;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/BaseActWebFragment.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BaseActWebFragment.java
similarity index 88%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/BaseActWebFragment.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BaseActWebFragment.java
index b2d6f5b4..0da6500f 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/BaseActWebFragment.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BaseActWebFragment.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.base;
+package com.example.libbase.agentwebview.activity;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -7,7 +7,8 @@
import androidx.annotation.Nullable;
-import com.example.slbappcomm.base.news.BaseAgentWebFragment;
+import com.just.agentweb.base.BaseAgentWebFragment;
+
public abstract class BaseActWebFragment extends BaseAgentWebFragment {
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/BasicsDisplayWebActDemo.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BasicsDisplayWebActDemo.java
similarity index 81%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/BasicsDisplayWebActDemo.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BasicsDisplayWebActDemo.java
index decb9ad7..f8c3314e 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/BasicsDisplayWebActDemo.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/BasicsDisplayWebActDemo.java
@@ -1,12 +1,12 @@
-package com.example.slbappcomm.agentwebview.activity;
+package com.example.libbase.agentwebview.activity;
import android.os.Bundle;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.BaseActWebActivity;
+import com.example.libbase.R;
+
public class BasicsDisplayWebActDemo extends BaseActWebActivity {
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/JsWebActDemo.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/JsWebActDemo.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/JsWebActDemo.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/JsWebActDemo.java
index 58bef9dd..824c83de 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/JsWebActDemo.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/JsWebActDemo.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.activity;
+package com.example.libbase.agentwebview.activity;
import android.content.Context;
import android.os.Bundle;
@@ -11,8 +11,7 @@
import androidx.annotation.Nullable;
import com.blankj.utilcode.util.ToastUtils;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.BaseActWebActivity;
+import com.example.libbase.R;
import com.just.agentweb.AgentWeb;
import org.json.JSONObject;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/SmartRefreshWebActDemo.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/SmartRefreshWebActDemo.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/SmartRefreshWebActDemo.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/SmartRefreshWebActDemo.java
index f88ae6fd..2359f784 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/SmartRefreshWebActDemo.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/SmartRefreshWebActDemo.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.activity;
+package com.example.libbase.agentwebview.activity;
import android.content.Intent;
import android.net.Uri;
@@ -9,8 +9,7 @@
import androidx.annotation.Nullable;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.BaseActWebActivity;
+import com.example.libbase.R;
import com.geek.libutils.app.MyLogUtil;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/TablayouActDemo.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/TablayouActDemo.java
similarity index 89%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/TablayouActDemo.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/TablayouActDemo.java
index 688921db..0a8f2a1b 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/activity/TablayouActDemo.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/activity/TablayouActDemo.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.activity;
+package com.example.libbase.agentwebview.activity;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -17,19 +17,18 @@
import androidx.viewpager.widget.ViewPager;
import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.agentwebview.adapter.TabFragmentPagerAdapter;
-import com.example.slbappcomm.agentwebview.adapter.Tablayoutdapter;
-import com.example.slbappcomm.agentwebview.bean.HCategoryBean;
-import com.example.slbappcomm.agentwebview.bean.HCategoryBean1;
-import com.example.slbappcomm.agentwebview.bean.OneBean1;
-import com.example.slbappcomm.agentwebview.fragment.F2NewItem1;
-import com.example.slbappcomm.agentwebview.fragment.F2NewItem2;
-import com.example.slbappcomm.base.BaseActWebActivity;
-import com.example.slbappcomm.widgets.recyclerviewnice.XRecyclerView;
+import com.example.libbase.R;
+import com.example.libbase.widgets.ViewPagerSlide;
+import com.example.libbase.widgets.XRecyclerView;
import com.geek.libutils.app.FragmentHelper;
-import com.haier.cellarette.baselibrary.tablayout.ViewPagerSlide;
-import com.haier.cellarette.baselibrary.yanzheng.LocalBroadcastManagers;
+import com.example.libbase.agentwebview.adapter.TabFragmentPagerAdapter;
+import com.example.libbase.agentwebview.adapter.Tablayoutdapter;
+import com.example.libbase.agentwebview.bean.HCategoryBean;
+import com.example.libbase.agentwebview.bean.HCategoryBean1;
+import com.example.libbase.agentwebview.bean.OneBean1;
+import com.example.libbase.agentwebview.fragment.F2NewItem1;
+import com.example.libbase.agentwebview.fragment.F2NewItem2;
+import com.geek.libutils.app.LocalBroadcastManagers;
import java.util.ArrayList;
import java.util.List;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/adapter/TabFragmentPagerAdapter.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/adapter/TabFragmentPagerAdapter.java
similarity index 89%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/adapter/TabFragmentPagerAdapter.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/adapter/TabFragmentPagerAdapter.java
index d86c3730..9d59df0e 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/adapter/TabFragmentPagerAdapter.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/adapter/TabFragmentPagerAdapter.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.adapter;
+package com.example.libbase.agentwebview.adapter;
import android.content.Context;
@@ -8,7 +8,7 @@
import java.util.List;
-public class TabFragmentPagerAdapter extends androidx.fragment.app.FragmentPagerAdapter {
+public class TabFragmentPagerAdapter extends FragmentPagerAdapter {
private Context mContext;
private List fragmentList;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/adapter/Tablayoutdapter.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/adapter/Tablayoutdapter.java
similarity index 87%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/adapter/Tablayoutdapter.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/adapter/Tablayoutdapter.java
index 43b71693..62f434dd 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/adapter/Tablayoutdapter.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/adapter/Tablayoutdapter.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.adapter;
+package com.example.libbase.agentwebview.adapter;
import android.view.View;
import android.widget.TextView;
@@ -7,8 +7,8 @@
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.agentwebview.bean.OneBean1;
+import com.example.libbase.R;
+import com.example.libbase.agentwebview.bean.OneBean1;
public class Tablayoutdapter extends BaseQuickAdapter {
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/HCategoryBean.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/HCategoryBean.java
similarity index 90%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/HCategoryBean.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/HCategoryBean.java
index b77e28dd..3e8aa4ba 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/HCategoryBean.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/HCategoryBean.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.bean;
+package com.example.libbase.agentwebview.bean;
import java.io.Serializable;
import java.util.List;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/HCategoryBean1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/HCategoryBean1.java
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/HCategoryBean1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/HCategoryBean1.java
index c4e6bb87..9a5d6fad 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/HCategoryBean1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/HCategoryBean1.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.bean;
+package com.example.libbase.agentwebview.bean;
import java.io.Serializable;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/OneBean1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/OneBean1.java
similarity index 94%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/OneBean1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/OneBean1.java
index fb679f1b..c752ea1f 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/bean/OneBean1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/bean/OneBean1.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.bean;
+package com.example.libbase.agentwebview.bean;
import java.io.Serializable;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/fragment/F2NewItem1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/fragment/F2NewItem1.java
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/fragment/F2NewItem1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/fragment/F2NewItem1.java
index 7bc79364..f93270f4 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/fragment/F2NewItem1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/fragment/F2NewItem1.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.fragment;
+package com.example.libbase.agentwebview.fragment;
import android.content.Context;
import android.os.Bundle;
@@ -11,9 +11,9 @@
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.BaseActWebFragment;
+import com.example.libbase.R;
import com.just.agentweb.AgentWeb;
+import com.example.libbase.agentwebview.activity.BaseActWebFragment;
public class F2NewItem1 extends BaseActWebFragment {
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/fragment/F2NewItem2.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/fragment/F2NewItem2.java
similarity index 86%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/fragment/F2NewItem2.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/fragment/F2NewItem2.java
index 7e9cd301..176e30e6 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/agentwebview/fragment/F2NewItem2.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/agentwebview/fragment/F2NewItem2.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.agentwebview.fragment;
+package com.example.libbase.agentwebview.fragment;
import android.os.Bundle;
import android.text.TextUtils;
@@ -8,8 +8,8 @@
import androidx.annotation.Nullable;
import com.blankj.utilcode.util.LogUtils;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.BaseActWebFragment;
+import com.example.libbase.R;
+import com.example.libbase.agentwebview.activity.BaseActWebFragment;
public class F2NewItem2 extends BaseActWebFragment {
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseActivity.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivity.java
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseActivity.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivity.java
index 374162e2..e5c6b7df 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseActivity.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivity.java
@@ -1,7 +1,7 @@
/**
* Copyright 2016,Smart Haier.All rights reserved
*/
-package com.example.slbappcomm.base;
+package com.example.libbase.base;
import android.app.Activity;
import android.content.Context;
@@ -28,11 +28,12 @@
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.BarUtils;
-import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.blankj.utilcode.util.Utils;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.huyan.Huyanservices;
+import com.example.libbase.R;
+import com.example.libbase.widgets.IBaseAction;
+import com.example.libbase.netstate.NetState;
+import com.example.libbase.netstate.NetconListener;
import com.example.swipebacklayout.SwipeBack;
import com.example.swipebacklayout.SwipeBackLayout;
import com.example.swipebacklayout.SwipeBackUtil;
@@ -41,14 +42,11 @@
import com.geek.libutils.SlbLoginUtil;
import com.geek.libutils.app.BaseAppManager;
import com.geek.libutils.app.BaseViewHelper;
-import com.haier.cellarette.baselibrary.networkview.NetState;
-import com.haier.cellarette.baselibrary.networkview.NetconListener2;
-import com.haier.cellarette.baselibrary.smartbar.IBaseAction;
-import com.umeng.analytics.MobclickAgent;
import me.jessyan.autosize.AutoSizeCompat;
-public abstract class SlbBaseActivity extends AppCompatActivity implements SwipeBackActivityBase, IBaseAction, NetconListener2 {
+public abstract class SlbBaseActivity extends AppCompatActivity implements SwipeBackActivityBase,
+ IBaseAction, NetconListener {
public static final String REQUEST_CODE = "request_code";
@@ -109,7 +107,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
//
BaseAppManager.getInstance().add(this);
setContentView(getLayoutId());
- BarUtils.setStatusBarColor(this, ContextCompat.getColor(this, R.color.black_000));
+ BarUtils.setStatusBarColor(this, ContextCompat.getColor(this, R.color.transparent));
BarUtils.setStatusBarLightMode(this, false);
setup(savedInstanceState);
//网络监听
@@ -183,16 +181,16 @@ protected void onResume() {
super.onResume();
// JPushInterface.onResume(this);
// MobEvent.onResume(this);
- MobclickAgent.onResume(this);
+// MobclickAgent.onResume(this);
}
@Override
protected void onPause() {
super.onPause();
// JPushInterface.onPause(this);
- MobclickAgent.onPause(this);
+// MobclickAgent.onPause(this);
// MobEvent.onPause(this);
-// AppUtils.registerAppStatusChangedListener(baseAppStatusChangedListener);
+ AppUtils.registerAppStatusChangedListener(baseAppStatusChangedListener);
}
protected Utils.OnAppStatusChangedListener baseAppStatusChangedListener = new Utils.OnAppStatusChangedListener() {
@@ -201,17 +199,17 @@ protected void onPause() {
public void onForeground(Activity activity) {
// 前台
// 护眼模式bufen
- if (SPUtils.getInstance().getBoolean("huyan", false)) {
- startService(new Intent(SlbBaseActivity.this, Huyanservices.class));
- }
+// if (SPUtils.getInstance().getBoolean("huyan", false)) {
+// startService(new Intent(SlbBaseActivity.this, Huyanservices.class));
+// }
}
@Override
public void onBackground(Activity activity) {
// 后台
- if (SPUtils.getInstance().getBoolean("huyan", false)) {
- stopService(new Intent(SlbBaseActivity.this, Huyanservices.class));
- }
+// if (SPUtils.getInstance().getBoolean("huyan", false)) {
+// stopService(new Intent(SlbBaseActivity.this, Huyanservices.class));
+// }
}
};
@@ -341,7 +339,7 @@ protected void onDestroy() {
}
hideSoftKeyboard();
// ShowLoadingUtil.onDestory();
-// AppUtils.unregisterAppStatusChangedListener(baseAppStatusChangedListener);
+ AppUtils.unregisterAppStatusChangedListener(baseAppStatusChangedListener);
super.onDestroy();
}
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseActivityPermissions.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivityPermissions.java
similarity index 88%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseActivityPermissions.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivityPermissions.java
index 073c278e..138dd6f4 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseActivityPermissions.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivityPermissions.java
@@ -1,8 +1,7 @@
-package com.example.slbappcomm.base;
+package com.example.libbase.base;
import android.Manifest;
-import com.example.slbappcomm.base.news.SlbBaseActivityPermissionsBase;
public class SlbBaseActivityPermissions extends SlbBaseActivityPermissionsBase {
/**
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/news/SlbBaseActivityPermissionsBase.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivityPermissionsBase.java
similarity index 97%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/news/SlbBaseActivityPermissionsBase.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivityPermissionsBase.java
index 2f95ee0c..f22b9168 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/news/SlbBaseActivityPermissionsBase.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseActivityPermissionsBase.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.base.news;
+package com.example.libbase.base;
import android.Manifest;
import android.annotation.TargetApi;
@@ -14,8 +14,8 @@
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.ScreenUtils;
-import com.example.slbappcomm.base.SlbBaseActivity;
-import com.haier.cellarette.baselibrary.R;
+import com.example.libbase.R;
+import com.example.libbase.base.SlbBaseActivity;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -237,11 +237,11 @@ private void showMissingPermissionDialog() {
//
// builder.show();
- dialog = new Dialog(this, R.style.notice_dialog);
+ dialog = new Dialog(this, R.style.basenotice_dialog);
if (dialog.isShowing()) {
return;
}
- dialog.setContentView(R.layout.notice_dialog);
+ dialog.setContentView(R.layout.notice_dialogbase);
dialog.setCancelable(false);
dialog.show();
TextView tv_notice = dialog.findViewById(R.id.tv_notice);
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseFragment.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseFragment.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseFragment.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseFragment.java
index 4a4031fa..035b78c2 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseFragment.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseFragment.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.base;
+package com.example.libbase.base;
import android.app.Activity;
import android.content.Intent;
@@ -9,14 +9,13 @@
import androidx.annotation.IdRes;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
+
+import com.example.libbase.netstate.NetState;
+import com.example.libbase.netstate.NetconListener;
import com.geek.libutils.SlbLoginUtil;
import com.geek.libutils.app.BaseViewHelper;
-import com.haier.cellarette.baselibrary.networkview.NetState;
-import com.haier.cellarette.baselibrary.networkview.NetconListener2;
-
-import java.util.Objects;
-public abstract class SlbBaseFragment extends Fragment implements NetconListener2 {
+public abstract class SlbBaseFragment extends Fragment implements NetconListener {
private long mCurrentMs = System.currentTimeMillis();
protected NetState netState;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseLazyFragmentNew.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseLazyFragmentNew.java
similarity index 85%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseLazyFragmentNew.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseLazyFragmentNew.java
index 9003bb79..c5c1af93 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/SlbBaseLazyFragmentNew.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseLazyFragmentNew.java
@@ -1,17 +1,12 @@
-package com.example.slbappcomm.base;
+package com.example.libbase.base;
import android.app.ProgressDialog;
-import android.content.BroadcastReceiver;
import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
import android.os.Bundle;
-import android.text.TextUtils;
import androidx.annotation.Nullable;
-import com.example.slbappcomm.utils.CommonUtils;
-import com.haier.cellarette.baselibrary.yanzheng.LocalBroadcastManagers;
+import com.example.libbase.base.SlbBaseFragment;
public abstract class SlbBaseLazyFragmentNew extends SlbBaseFragment {
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/old/SlbBaseLazyFragmentOld.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseLazyFragmentOld.java
similarity index 96%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/old/SlbBaseLazyFragmentOld.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseLazyFragmentOld.java
index 56533628..70eed3b2 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/base/old/SlbBaseLazyFragmentOld.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/base/SlbBaseLazyFragmentOld.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.base.old;
+package com.example.libbase.base;
import android.os.Bundle;
import android.view.View;
@@ -6,8 +6,6 @@
import androidx.annotation.Nullable;
-import com.example.slbappcomm.base.SlbBaseFragment;
-
public abstract class SlbBaseLazyFragmentOld extends SlbBaseFragment {
/**
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityViewPage.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityViewPage.java
similarity index 93%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityViewPage.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityViewPage.java
index 1d8b5f1a..0bcd3cd2 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityViewPage.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityViewPage.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview;
+package com.example.libbase.baserecycleview;
import android.graphics.Typeface;
import android.os.Bundle;
@@ -12,15 +12,14 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.R;
+import com.example.libbase.base.SlbBaseActivity;
+import com.example.libbase.emptyview.EmptyViewNewNew;
+import com.example.libbase.widgets.TabSelectAdapter;
+import com.example.libbase.widgets.TabUtils;
+import com.example.libbase.widgets.ViewPagerSlide;
import com.geek.libutils.app.MyLogUtil;
import com.google.android.material.tabs.TabLayout;
-import com.haier.cellarette.baselibrary.emptyview.EmptyView;
-import com.haier.cellarette.baselibrary.emptyview.EmptyViewNew1;
-import com.haier.cellarette.baselibrary.tablayout.TabSelectAdapter;
-import com.haier.cellarette.baselibrary.tablayout.TabUtils;
-import com.haier.cellarette.baselibrary.tablayout.ViewPagerSlide;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@@ -35,7 +34,7 @@ public abstract class SlbBaseActivityViewPage extends SlbBaseActivity {
protected ImageView ivBack;
protected TextView tvCenterContent;
protected TextView tv_right;
- protected EmptyViewNew1 emptyview;
+ protected EmptyViewNewNew emptyview;
protected LinearLayout ll_refresh1;
protected TabLayout tablayoutMy;
protected ViewPagerSlide viewpager_my1_order;
@@ -144,7 +143,7 @@ public void onClick(View view) {
onBackPressed();
}
});
- emptyview.bind(ll_refresh1).setRetryListener(new EmptyView.RetryListener() {
+ emptyview.bind(ll_refresh1).setRetryListener(new EmptyViewNewNew.RetryListener() {
@Override
public void retry() {
// 主布局
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityViewPageTabBean1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityViewPageTabBean1.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityViewPageTabBean1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityViewPageTabBean1.java
index 34844252..5e6a7fd6 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityViewPageTabBean1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityViewPageTabBean1.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview;
+package com.example.libbase.baserecycleview;
import java.io.Serializable;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityYewuList.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityYewuList.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityYewuList.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityYewuList.java
index 45247e99..6bd30e94 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseActivityYewuList.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseActivityYewuList.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview;
+package com.example.libbase.baserecycleview;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -16,13 +16,13 @@
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.SlbBaseActivity;
-import com.example.slbappcomm.utils.CommonUtils;
-import com.example.slbappcomm.widgets.recyclerviewnice.XRecyclerView;
+import com.example.libbase.R;
+import com.example.libbase.base.SlbBaseActivity;
+import com.example.libbase.emptyview.NiubiEmptyViewNew;;
+import com.example.libbase.utils.CommonUtils;
+import com.example.libbase.widgets.XRecyclerView;
+import com.geek.libutils.app.LocalBroadcastManagers;
import com.geek.libutils.app.MyLogUtil;
-import com.haier.cellarette.baselibrary.emptyview.NiubiEmptyView;
-import com.haier.cellarette.baselibrary.yanzheng.LocalBroadcastManagers;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
@@ -39,7 +39,7 @@ public abstract class SlbBaseActivityYewuList extends SlbBaseActivity {
protected ImageView ivBack;
protected TextView tvCenterContent;
protected TextView tv_right;
- protected NiubiEmptyView niubiEmptyView;
+ protected NiubiEmptyViewNew niubiEmptyView;
protected static final int PAGE_SIZE = 10;
protected int mNextRequestPage = 1;
protected int mPage;
@@ -150,7 +150,7 @@ private void findview() {
tv_right = findViewById(R.id.baserecycleview_tv_right1);
recyclerView1 = findViewById(R.id.baserecycleview_recycler_view1);
findviewAdd();
- niubiEmptyView = new NiubiEmptyView();
+ niubiEmptyView = new NiubiEmptyViewNew();
niubiEmptyView.bind(this, recyclerView1, mAdapter1);
}
@@ -254,7 +254,7 @@ public void onLoadMoreRequested() {
MyLogUtil.e("--geekyun--", "loadMore");
}
}, recyclerView1);
- niubiEmptyView.setRetry(new NiubiEmptyView.RetryListener() {
+ niubiEmptyView.setRetry(new NiubiEmptyViewNew.RetryListener() {
@Override
public void retry() {
niubiEmptyView.loading("");
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseFragmentViewPageYewuList.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseFragmentViewPageYewuList.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseFragmentViewPageYewuList.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseFragmentViewPageYewuList.java
index 994fc82c..fbb6badd 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseFragmentViewPageYewuList.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseFragmentViewPageYewuList.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview;
+package com.example.libbase.baserecycleview;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -16,14 +16,14 @@
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.base.SlbBaseLazyFragmentNew;
-import com.example.slbappcomm.utils.CommonUtils;
-import com.example.slbappcomm.widgets.recyclerviewnice.XRecyclerView;
+
+import com.example.libbase.R;
+import com.example.libbase.base.SlbBaseLazyFragmentNew;
+import com.example.libbase.utils.CommonUtils;
+import com.example.libbase.emptyview.EmptyViewNewNew;
+import com.example.libbase.widgets.XRecyclerView;
+import com.geek.libutils.app.LocalBroadcastManagers;
import com.geek.libutils.app.MyLogUtil;
-import com.haier.cellarette.baselibrary.emptyview.EmptyView;
-import com.haier.cellarette.baselibrary.emptyview.EmptyViewNew1;
-import com.haier.cellarette.baselibrary.yanzheng.LocalBroadcastManagers;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
@@ -48,7 +48,7 @@ public abstract class SlbBaseFragmentViewPageYewuList extends SlbBaseLazyFragmen
private int firstVisibleItemPosition = 0;
private boolean b;
//
- protected EmptyViewNew1 emptyview1;
+ protected EmptyViewNewNew emptyview1;
protected LinearLayout ll_refresh1;
protected XRecyclerView recyclerView1;
protected BaseQuickAdapter mAdapter1;
@@ -225,7 +225,7 @@ public void onLoadMoreRequested() {
MyLogUtil.e("--geekyun--", "loadMore");
}
}, recyclerView1);
- emptyview1.bind(refreshLayout1).setRetryListener(new EmptyView.RetryListener() {
+ emptyview1.bind(refreshLayout1).setRetryListener(new EmptyViewNewNew.RetryListener() {
@Override
public void retry() {
// 分布局
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseFragmentViewPagerAdapter.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseFragmentViewPagerAdapter.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseFragmentViewPagerAdapter.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseFragmentViewPagerAdapter.java
index 82fd739c..8f2d3f8a 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseFragmentViewPagerAdapter.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseFragmentViewPagerAdapter.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview;
+package com.example.libbase.baserecycleview;
import android.content.Context;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseViewPageBroadcastUtils.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseViewPageBroadcastUtils.java
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseViewPageBroadcastUtils.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseViewPageBroadcastUtils.java
index 7f1485cf..5c646c4f 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/SlbBaseViewPageBroadcastUtils.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/SlbBaseViewPageBroadcastUtils.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview;
+package com.example.libbase.baserecycleview;
import android.content.Context;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/ActViewPageYewuList1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/ActViewPageYewuList1.java
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/ActViewPageYewuList1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/ActViewPageYewuList1.java
index 9d854ecf..a539e04f 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/ActViewPageYewuList1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/ActViewPageYewuList1.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview.yewu1;
+package com.example.libbase.baserecycleview.yewu1;
import android.content.Intent;
import android.graphics.drawable.Drawable;
@@ -8,13 +8,14 @@
import androidx.fragment.app.Fragment;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.baserecycleview.SlbBaseActivityViewPage;
-import com.example.slbappcomm.baserecycleview.SlbBaseActivityViewPageTabBean1;
-import com.example.slbappcomm.utils.CommonUtils;
+
+import com.example.libbase.R;
+import com.example.libbase.baserecycleview.SlbBaseActivityViewPage;
+import com.example.libbase.baserecycleview.SlbBaseActivityViewPageTabBean1;
+import com.example.libbase.utils.CommonUtils;
import com.example.swipebacklayout.SwipeBack;
import com.geek.libutils.app.FragmentHelper;
-import com.haier.cellarette.baselibrary.yanzheng.LocalBroadcastManagers;
+import com.geek.libutils.app.LocalBroadcastManagers;
import com.haier.cellarette.libwebview.hois2.HiosHelper;
import java.util.ArrayList;
@@ -84,7 +85,7 @@ protected void onclickAdd() {
@Override
protected void findviewAdd() {
tv_right.setVisibility(View.VISIBLE);
- select_useful(tv_right, R.drawable.ic_zhaoliying);
+ select_useful(tv_right, R.drawable.icon_jiantou3);
tv_right.setText("说明");
}
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/FragmentYewuList1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/FragmentYewuList1.java
similarity index 95%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/FragmentYewuList1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/FragmentYewuList1.java
index 4344620b..2df2ef83 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/FragmentYewuList1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/FragmentYewuList1.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview.yewu1;
+package com.example.libbase.baserecycleview.yewu1;
import android.os.Bundle;
import android.os.Handler;
@@ -10,9 +10,9 @@
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.baserecycleview.SlbBaseActivityViewPageTabBean1;
-import com.example.slbappcomm.baserecycleview.SlbBaseFragmentViewPageYewuList;
+import com.example.libbase.R;
+import com.example.libbase.baserecycleview.SlbBaseActivityViewPageTabBean1;
+import com.example.libbase.baserecycleview.SlbBaseFragmentViewPageYewuList;
import com.geek.libutils.app.MyLogUtil;
import java.util.ArrayList;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/YewuList1CommonAdapter.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/YewuList1CommonAdapter.java
similarity index 74%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/YewuList1CommonAdapter.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/YewuList1CommonAdapter.java
index 3de11e09..c5cad59c 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu1/YewuList1CommonAdapter.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu1/YewuList1CommonAdapter.java
@@ -1,11 +1,12 @@
-package com.example.slbappcomm.baserecycleview.yewu1;
+package com.example.libbase.baserecycleview.yewu1;
import android.widget.TextView;
+
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.baserecycleview.SlbBaseActivityViewPageTabBean1;
-import com.haier.cellarette.baselibrary.widget.LxRelativeLayout;
+import com.example.libbase.R;
+import com.example.libbase.baserecycleview.SlbBaseActivityViewPageTabBean1;
+import com.example.libbase.widgets.LxRelativeLayout;
public class YewuList1CommonAdapter extends BaseQuickAdapter {
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu2/ActYewuList1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu2/ActYewuList1.java
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu2/ActYewuList1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu2/ActYewuList1.java
index ecc7afbd..9cafa374 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu2/ActYewuList1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu2/ActYewuList1.java
@@ -1,4 +1,4 @@
-package com.example.slbappcomm.baserecycleview.yewu2;
+package com.example.libbase.baserecycleview.yewu2;
import android.content.Intent;
import android.net.Uri;
@@ -10,15 +10,15 @@
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.baserecycleview.SlbBaseActivityViewPageTabBean1;
-import com.example.slbappcomm.baserecycleview.SlbBaseActivityYewuList;
-import com.example.slbappcomm.playermusic.floatbutton.floatbutton2.DisplayUtil;
-import com.example.slbappcomm.utils.CommonUtils;
-import com.example.slbappcomm.widgets.recyclerviewnice.GridSpacingItemDecoration;
+import com.example.libbase.R;
+import com.example.libbase.baserecycleview.SlbBaseActivityViewPageTabBean1;
+import com.example.libbase.baserecycleview.SlbBaseActivityYewuList;
+import com.example.libbase.utils.CommonUtils;
+import com.example.libbase.widgets.GridSpacingItemDecoration;
import com.example.swipebacklayout.SwipeBack;
+import com.geek.libglide47.base.util.DisplayUtil;
+import com.geek.libutils.app.LocalBroadcastManagers;
import com.geek.libutils.app.MyLogUtil;
-import com.haier.cellarette.baselibrary.yanzheng.LocalBroadcastManagers;
import com.haier.cellarette.libwebview.hois2.HiosHelper;
import java.util.ArrayList;
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu2/YewuList2CommonAdapter.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu2/YewuList2CommonAdapter.java
similarity index 74%
rename from yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu2/YewuList2CommonAdapter.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu2/YewuList2CommonAdapter.java
index a7ea5c32..2e5660ff 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/java/com/example/slbappcomm/baserecycleview/yewu2/YewuList2CommonAdapter.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/baserecycleview/yewu2/YewuList2CommonAdapter.java
@@ -1,12 +1,12 @@
-package com.example.slbappcomm.baserecycleview.yewu2;
+package com.example.libbase.baserecycleview.yewu2;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
-import com.example.slbappcomm.R;
-import com.example.slbappcomm.baserecycleview.SlbBaseActivityViewPageTabBean1;
-import com.haier.cellarette.baselibrary.widget.LxRelativeLayout;
+import com.example.libbase.R;
+import com.example.libbase.baserecycleview.SlbBaseActivityViewPageTabBean1;
+import com.example.libbase.widgets.LxRelativeLayout;
public class YewuList2CommonAdapter extends BaseQuickAdapter {
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/EmptyViewHelper.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/EmptyViewHelper.java
new file mode 100644
index 00000000..896849dd
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/EmptyViewHelper.java
@@ -0,0 +1,39 @@
+package com.example.libbase.emptyview;
+
+import android.app.Activity;
+import android.view.View;
+
+import androidx.annotation.IdRes;
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
+
+public class EmptyViewHelper {
+ @SuppressWarnings("unchecked")
+ public static T f(Activity activity, @IdRes int resId) {
+ return (T) activity.findViewById(resId);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static T f(View rootView, @IdRes int resId) {
+ return (T) rootView.findViewById(resId);
+ }
+
+ public static void click(View.OnClickListener li, View... views) {
+ if (views == null || views.length == 0) return;
+ for (View v : views) {
+ v.setOnClickListener(li);
+ }
+ }
+
+ public static void setRefreshColor(SwipeRefreshLayout swipe) {
+ swipe.setColorSchemeColors(0xff33b5e5, 0xffff4444, 0xffffbb33, 0xff99cc00);
+ }
+
+ public static void setVisable(Boolean is, View... views) {
+ if (views == null || views.length == 0) return;
+ for (View v : views) {
+ if (is) v.setVisibility(View.VISIBLE);
+ else v.setVisibility(View.GONE);
+ }
+ }
+}
+
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/EmptyViewNew1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/EmptyViewNewNew.java
similarity index 93%
rename from commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/EmptyViewNew1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/EmptyViewNewNew.java
index e1d1bb20..6d7080bb 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/EmptyViewNew1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/EmptyViewNewNew.java
@@ -1,4 +1,4 @@
-package com.haier.cellarette.baselibrary.emptyview;
+package com.example.libbase.emptyview;
import android.content.Context;
import android.content.res.TypedArray;
@@ -15,7 +15,7 @@
import com.airbnb.lottie.LottieAnimationView;
import com.airbnb.lottie.LottieComposition;
import com.airbnb.lottie.OnCompositionLoadedListener;
-import com.haier.cellarette.baselibrary.R;
+import com.example.libbase.R;
/**
* 数据加载中/失败默认布局
@@ -69,7 +69,7 @@
* });
*/
-public class EmptyViewNew1 extends FrameLayout implements View.OnClickListener {
+public class EmptyViewNewNew extends FrameLayout implements View.OnClickListener {
private AnimationDrawable ad = null;
public int is_an;// 0 src 1 an
@@ -106,26 +106,26 @@ public void setmNodataLayout(View mNodataLayout) {
private View mBindView;
- private EmptyView.RetryListener mListener;
- private EmptyView.UnReachableListener mUnReachableListener;
+ private EmptyViewNewNew.RetryListener mListener;
+ private EmptyViewNewNew.UnReachableListener mUnReachableListener;
- private EmptyView.RetryListener2 mListener2;
- private EmptyView.UnReachableListener2 mUnReachableListener2;
+ private EmptyViewNewNew.RetryListener2 mListener2;
+ private EmptyViewNewNew.UnReachableListener2 mUnReachableListener2;
// 数据为空,网络失败, 加载中 无网络连接
private String[] mNoticeString = new String[]{"暂无数据", "没有网络了,检查一下吧", "正在加载…", ""};
- public EmptyViewNew1(Context context) {
+ public EmptyViewNewNew(Context context) {
this(context, null, 0);
this.context = context;
}
- public EmptyViewNew1(Context context, AttributeSet attrs) {
+ public EmptyViewNewNew(Context context, AttributeSet attrs) {
this(context, attrs, 0);
this.context = context;
}
- public EmptyViewNew1(Context context, AttributeSet attrs, int defStyleAttr) {
+ public EmptyViewNewNew(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EmptyView, defStyleAttr, 0);
@@ -391,7 +391,7 @@ private void bindViewVisible(int visibility) {
* @param view
* @return
*/
- public EmptyViewNew1 bind(View view) {
+ public EmptyViewNewNew bind(View view) {
mBindView = view;
return this;
}
@@ -402,7 +402,7 @@ public EmptyViewNew1 bind(View view) {
* @param view
* @return
*/
- public EmptyViewNew1 attach(View view) {
+ public EmptyViewNewNew attach(View view) {
mBindView = view;
if (view.getParent() instanceof ViewGroup) {
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
@@ -423,7 +423,7 @@ public EmptyViewNew1 attach(View view) {
* 3: 无网络连接
* @return
*/
- public EmptyViewNew1 notices(String... notices) {
+ public EmptyViewNewNew notices(String... notices) {
int length = notices.length > mNoticeString.length ? mNoticeString.length : notices.length;
for (int i = 0; i < length; i++) {
mNoticeString[i] = notices[i];
@@ -440,7 +440,7 @@ public EmptyViewNew1 notices(String... notices) {
* @param is_an
* @return
*/
- public EmptyViewNew1 setIs_an(int is_an) {
+ public EmptyViewNewNew setIs_an(int is_an) {
this.is_an = is_an;
setText();
return this;
@@ -471,19 +471,19 @@ public void onClick(View v) {
*
* @param li
*/
- public void setRetryListener(EmptyView.RetryListener li) {
+ public void setRetryListener(EmptyViewNewNew.RetryListener li) {
mListener = li;
}
- public void setRetryListener2(EmptyView.RetryListener2 li) {
+ public void setRetryListener2(EmptyViewNewNew.RetryListener2 li) {
mListener2 = li;
}
- public void setUnReachableListener(EmptyView.UnReachableListener li) {
+ public void setUnReachableListener(EmptyViewNewNew.UnReachableListener li) {
mUnReachableListener = li;
}
- public void setUnReachableListener2(EmptyView.UnReachableListener2 li) {
+ public void setUnReachableListener2(EmptyViewNewNew.UnReachableListener2 li) {
mUnReachableListener2 = li;
}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/NiubiEmptyViewNew1.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/NiubiEmptyViewNew.java
similarity index 95%
rename from commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/NiubiEmptyViewNew1.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/NiubiEmptyViewNew.java
index b747fbca..dab39292 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/emptyview/NiubiEmptyViewNew1.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/emptyview/NiubiEmptyViewNew.java
@@ -1,4 +1,4 @@
-package com.haier.cellarette.baselibrary.emptyview;
+package com.example.libbase.emptyview;
import android.app.Activity;
import android.content.Context;
@@ -13,9 +13,9 @@
import com.airbnb.lottie.LottieComposition;
import com.airbnb.lottie.OnCompositionLoadedListener;
import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.haier.cellarette.baselibrary.R;
+import com.example.libbase.R;
-public class NiubiEmptyViewNew1 {
+public class NiubiEmptyViewNew {
private Context context;
private View loadingView;
@@ -30,7 +30,7 @@ public class NiubiEmptyViewNew1 {
private BaseQuickAdapter mAdapter;
- public NiubiEmptyViewNew1 bind(Context context, View mRecyclerView, BaseQuickAdapter mAdapter) {
+ public NiubiEmptyViewNew bind(Context context, View mRecyclerView, BaseQuickAdapter mAdapter) {
this.context = context;
this.mAdapter = mAdapter;
// loadingView = ((Activity) context).getLayoutInflater().inflate(R.layout.activity_recycleviewallsuses_demo8_viewloading, (ViewGroup) mRecyclerView.getParent(), false);
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/netstate/NetState.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/netstate/NetState.java
new file mode 100644
index 00000000..b70d735c
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/netstate/NetState.java
@@ -0,0 +1,84 @@
+package com.example.libbase.netstate;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.wifi.WifiManager;
+
+import java.lang.reflect.Method;
+
+public class NetState {
+ private boolean isUpdate = false;
+ public NetconListener mNet_con;
+ private Context mContext;
+ private NetworkChangeListener networkChangeListener;
+
+ public void setNetStateListener(NetconListener listener, Context context) {
+ mNet_con = listener;
+ if (mNet_con == null || context == null)
+ return;
+ mContext = context;
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
+ filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+ filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
+ networkChangeListener = new NetworkChangeListener();
+ context.registerReceiver(networkChangeListener, filter);
+ }
+
+ private class NetworkChangeListener extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
+ ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ if (connManager == null)
+ return;
+
+ NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+ NetworkInfo mobile = connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
+
+ if (!isUpdate && ((wifi != null && wifi.isConnected()) || (mobile != null && mobile.isConnected()))) {//有网但没刷新
+ if (mobile != null && mobile.isConnected() && mNet_con != null) {//移动网络
+ //如果点击刷新需要调用setUpdate设置update状态
+ mNet_con.showNetPopup();
+ } else if (mNet_con != null && wifi != null && wifi.isConnected()) {//wifi
+ isUpdate = true;
+ mNet_con.net_con_success();
+ }
+ } else if (wifi != null && !wifi.isConnected() && mobile != null && !mobile.isConnected()) {//没有网络
+ isUpdate = false;
+ if (mNet_con != null) {
+ mNet_con.net_con_none();
+ }
+ }
+ }
+ }
+ }
+
+ public void unregisterReceiver() {
+ if (mContext != null && networkChangeListener != null) {
+ mContext.unregisterReceiver(networkChangeListener);
+ }
+ }
+
+ public void setUpdate(boolean update) {
+ isUpdate = update;
+ }
+
+ public boolean isMobileEnableReflex(Context context) {
+ try {
+ ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext()
+ .getSystemService(Context.CONNECTIVITY_SERVICE);
+ Method getMobileDataEnabledMethod = ConnectivityManager.class.getDeclaredMethod("getMobileDataEnabled");
+ getMobileDataEnabledMethod.setAccessible(true);
+ return (Boolean) getMobileDataEnabledMethod.invoke(connectivityManager);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/netstate/NetconListener.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/netstate/NetconListener.java
new file mode 100644
index 00000000..59f46a78
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/netstate/NetconListener.java
@@ -0,0 +1,9 @@
+package com.example.libbase.netstate;
+
+public interface NetconListener {
+ void net_con_none();
+
+ void net_con_success();
+
+ void showNetPopup();
+}
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/utils/CommonUtils.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/utils/CommonUtils.java
new file mode 100644
index 00000000..ee24eb76
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/utils/CommonUtils.java
@@ -0,0 +1,23 @@
+package com.example.libbase.utils;
+
+public class CommonUtils {
+ public static final String APP_VERSION_CODE = "当前版本号";//
+ public static final String MMKV_SEX = "用户性别";//
+ public static final String MMKV_IMG = "用户头像";//
+ public static final String MMKV_TEL = "用户电话";//
+ public static final String MMKV_NAME = "用户昵称";//
+ public static final String MMKV_TOKEN = "用户token";//
+ public static final String MMKV_forceLogin = "是否强制登录";// 1 强 0非
+ public static final String MMKV_serviceProtocol = "用户服务协议";//
+ public static final String MMKV_privacyPolicy = "隐私政策";//
+ public static final String SlbBaseActivityViewPageAct = "刷新滚动广播";//
+ public static final String ActYewuList1 = "刷新滚动广播Activity";//
+ public static final String SlbBaseAct_update = "刷新";//
+ public static final String SlbBaseAct_scroll = "滚动";//
+ public static final String SlbBaseActivityViewPageAct1 = "刷新滚动广播-业务1";//
+ public static String TIPS_WUSHUJU = "暂无数据";//
+ public static String TIPS_WUWANG = "请确认网络是否可用";//
+ public static final String LB_broadcastreceiver = "LB_broadcastreceiver";// 监听第三方来电音乐变化
+ public static final String RB_broadcastreceiver = "RB_broadcastreceiver";// 监听第三方来电音乐变化
+
+}
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/GridSpacingItemDecoration.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/GridSpacingItemDecoration.java
new file mode 100644
index 00000000..203968cf
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/GridSpacingItemDecoration.java
@@ -0,0 +1,41 @@
+package com.example.libbase.widgets;
+
+import android.graphics.Rect;
+import android.view.View;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+public class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
+
+ private int spanCount;
+ private int spacing;
+ private boolean includeEdge;
+
+ public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
+ this.spanCount = spanCount;
+ this.spacing = spacing;
+ this.includeEdge = includeEdge;
+ }
+
+ @Override
+ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+ int position = parent.getChildAdapterPosition(view);
+ int column = position % spanCount;
+
+ if (includeEdge) {
+ outRect.left = spacing - column * spacing / spanCount;
+ outRect.right = (column + 1) * spacing / spanCount;
+
+ if (position < spanCount) {
+ outRect.top = spacing;
+ }
+ outRect.bottom = spacing;
+ } else {
+ outRect.left = column * spacing / spanCount;
+ outRect.right = spacing - (column + 1) * spacing / spanCount;
+ if (position >= spanCount) {
+ outRect.top = spacing;
+ }
+ }
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/IBaseAction.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/IBaseAction.java
similarity index 72%
rename from commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/IBaseAction.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/IBaseAction.java
index bcde7eb4..82a3e020 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/IBaseAction.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/IBaseAction.java
@@ -1,4 +1,4 @@
-package com.haier.cellarette.baselibrary.smartbar;
+package com.example.libbase.widgets;
import android.app.Activity;
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/LxRelativeLayout.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/LxRelativeLayout.java
new file mode 100644
index 00000000..f0ca6478
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/LxRelativeLayout.java
@@ -0,0 +1,38 @@
+package com.example.libbase.widgets;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.widget.RelativeLayout;
+
+import com.example.libbase.R;
+
+public class LxRelativeLayout extends RelativeLayout {
+
+ private boolean itouch = false;
+
+ public LxRelativeLayout(Context context) {
+ super(context);
+ }
+
+ public LxRelativeLayout(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public LxRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.LxLayout, defStyleAttr, 0);
+ itouch = array.getBoolean(R.styleable.LxLayout_is_touch, false);
+ array.recycle();
+ }
+
+ @Override
+ public boolean onInterceptTouchEvent(MotionEvent ev) {
+ return itouch;
+ }
+
+ public void setTouch(boolean is) {
+ itouch = is;
+ }
+}
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/SmartBar.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/SmartBar.java
similarity index 97%
rename from commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/SmartBar.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/SmartBar.java
index b74759dd..49ceb6d8 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/SmartBar.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/SmartBar.java
@@ -1,4 +1,4 @@
-package com.haier.cellarette.baselibrary.smartbar;
+package com.example.libbase.widgets;
import android.content.Context;
import android.content.res.TypedArray;
@@ -7,7 +7,7 @@
import android.widget.ImageView;
import android.widget.LinearLayout;
-import com.haier.cellarette.baselibrary.R;
+import com.example.libbase.R;
public class SmartBar extends LinearLayout {
diff --git a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/SmartBarInject.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/SmartBarInject.java
similarity index 91%
rename from commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/SmartBarInject.java
rename to commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/SmartBarInject.java
index 36bdd25d..51cbc737 100644
--- a/commonlibs/baselibrary/src/main/java/com/haier/cellarette/baselibrary/smartbar/SmartBarInject.java
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/SmartBarInject.java
@@ -1,9 +1,9 @@
-package com.haier.cellarette.baselibrary.smartbar;
+package com.example.libbase.widgets;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
-import com.haier.cellarette.baselibrary.R;
+import com.example.libbase.R;
public class SmartBarInject {
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/TabSelectAdapter.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/TabSelectAdapter.java
new file mode 100644
index 00000000..ea3544ed
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/TabSelectAdapter.java
@@ -0,0 +1,23 @@
+package com.example.libbase.widgets;
+
+//import android.support.design.widget.TabLayout;
+
+
+import com.google.android.material.tabs.TabLayout;
+
+public class TabSelectAdapter implements TabLayout.OnTabSelectedListener {
+ @Override
+ public void onTabSelected(TabLayout.Tab tab) {
+
+ }
+
+ @Override
+ public void onTabUnselected(TabLayout.Tab tab) {
+
+ }
+
+ @Override
+ public void onTabReselected(TabLayout.Tab tab) {
+
+ }
+}
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/TabUtils.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/TabUtils.java
new file mode 100644
index 00000000..5ef72c9d
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/TabUtils.java
@@ -0,0 +1,314 @@
+package com.example.libbase.widgets;
+
+import android.content.res.Resources;
+import android.graphics.Typeface;
+import android.util.TypedValue;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+
+import com.google.android.material.tabs.TabLayout;
+
+import java.lang.reflect.Field;
+
+/**
+ * 修改Tablayout tab的字体和shadow
+ * mCateTabLayout.addOnTabSelectedListener(new TabSelectAdapter() {
+ *
+ * @Override public void onTabSelected(TabLayout.Tab tab) {
+ * TabUtils.tabSelect(mCateTabLayout, tab);
+ * int tag = (int) tab.getTag();
+ * if (tag == -1) {
+ * return;
+ * }
+ * if (!once_footer) {
+ * once_footer = true;
+ * return;
+ * }
+ * footer_id = tag;
+ * 请求数据bufen
+ * set_refresh_data();
+ * }
+ * });
+ * mCateTabLayout.post(new Runnable() {
+ * @Override public void run() {
+ * TabUtils.setIndicator(mCateTabLayout, 80, 80);
+ * }
+ * });
+ */
+public class TabUtils {
+
+ public static void boldTab(TabLayout.Tab tab) {
+ setTabStyle(tab, Typeface.DEFAULT_BOLD, 0, 0, 0, 0);
+ }
+
+ /**
+ * 选中某条, 改变样式
+ *
+ * @param tabLayout
+ * @param currentTab
+ */
+ public static void tabSelect(TabLayout tabLayout, TabLayout.Tab currentTab) {
+ int tabCount = tabLayout.getTabCount();
+ TabLayout.Tab tab;
+ for (int i = 0; i < tabCount; i++) {
+ tab = tabLayout.getTabAt(i);
+ setTabStyle(tab, Typeface.DEFAULT, 0, 0, 0, 0x00000000);
+ }
+
+ setTabStyle(currentTab, Typeface.DEFAULT_BOLD, 1, 2, 2, 0x55000000);
+ }
+
+ public static void tabSelectAt(TabLayout tabLayout, TabLayout.Tab currentTab, int position) {
+ int tabCount = tabLayout.getTabCount();
+ TabLayout.Tab tab;
+ for (int i = 0; i < tabCount; i++) {
+ tab = tabLayout.getTabAt(i);
+ if (i != position) {
+ setTabStyle(tab, Typeface.DEFAULT, 0, 0, 0, 0x00000000);
+ } else {
+ setTabStyle(currentTab, Typeface.DEFAULT_BOLD, 1, 2, 2, 0x55000000);
+ }
+ }
+ }
+
+ /**
+ * 通过反射去设置样式
+ *
+ * @param tab
+ * @param tf
+ * @param radius
+ * @param dx
+ * @param dy
+ * @param color
+ */
+ public static void setTabStyle(TabLayout.Tab tab, Typeface tf, int radius, float dx, float dy, int color) {
+ TextView tv = getTextView(tab);
+ if (tv == null) {
+ return;
+ }
+ //TODO 暂时不做阴影效果
+ tv.setTypeface(tf);
+ tv.setShadowLayer(radius, dx, dy, color);
+ }
+
+ private static TextView getTextView(TabLayout.Tab tab) {
+ try {
+ Field mView = tab.getClass().getDeclaredField("mView");
+ mView.setAccessible(true);
+ Object mViewObj = mView.get(tab);
+ Field mTextView = mViewObj.getClass().getDeclaredField("mTextView");
+ mTextView.setAccessible(true);
+ return (TextView) mTextView.get(mViewObj);
+ } catch (Exception e) {
+
+ }
+
+ return null;
+ }
+
+ /**
+ * 通过反射去设置下划线样式bufen
+ *
+ * @param tab
+ * @param leftDip
+ * @param rightDip
+ */
+ public static void setIndicator(TabLayout tab, int leftDip, int rightDip) {
+ try {
+ Field tabStrip = TabLayout.class.getDeclaredField("mTabStrip");
+ tabStrip.setAccessible(true);
+ LinearLayout llTab = (LinearLayout) tabStrip.get(tab);
+ int left = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, leftDip, Resources.getSystem().getDisplayMetrics());
+ int right = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, rightDip, Resources.getSystem().getDisplayMetrics());
+
+ for (int i = 0; i < llTab.getChildCount(); i++) {
+ View child = llTab.getChildAt(i);
+ child.setPadding(0, 0, 0, 0);
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1);
+ params.leftMargin = left;
+ params.rightMargin = right;
+ child.setLayoutParams(params);
+ child.invalidate();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ public static void setIndicatorWidth(@NonNull final TabLayout tabLayout, final int margin) {
+ try {
+ // 拿到tabLayout的slidingTabIndicator属性
+ Field slidingTabIndicatorField = tabLayout.getClass().getDeclaredField("slidingTabIndicator");
+ slidingTabIndicatorField.setAccessible(true);
+ LinearLayout mTabStrip = (LinearLayout) slidingTabIndicatorField.get(tabLayout);
+ for (int i = 0; i < mTabStrip.getChildCount(); i++) {
+ View tabView = mTabStrip.getChildAt(i);
+ //拿到tabView的mTextView属性
+ Field textViewField = tabView.getClass().getDeclaredField("textView");
+ textViewField.setAccessible(true);
+ TextView mTextView = (TextView) textViewField.get(tabView);
+ tabView.setPadding(0, 0, 0, 0);
+ // 因为想要的效果是字多宽线就多宽,所以测量mTextView的宽度
+ int width = mTextView.getWidth();
+ if (width == 0) {
+ mTextView.measure(0, 0);
+ width = mTextView.getMeasuredWidth();
+ }
+
+ // 设置tab左右间距,注意这里不能使用Padding,因为源码中线的宽度是根据tabView的宽度来设置的
+ LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) tabView.getLayoutParams();
+ params.width = width;
+ params.leftMargin = margin;
+ params.rightMargin = margin;
+ tabView.setLayoutParams(params);
+ tabView.invalidate();
+ }
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+// tabLayout.post(new Runnable() {
+// @Override
+// public void run() {
+//
+// }
+// });
+ }
+
+
+ public static void setIndicatorWidth(@NonNull final TabLayout tabLayout, final int margin, final int tvWidth) {
+ try {
+ // 拿到tabLayout的slidingTabIndicator属性
+ Field slidingTabIndicatorField = tabLayout.getClass().getDeclaredField("slidingTabIndicator");
+ slidingTabIndicatorField.setAccessible(true);
+ LinearLayout mTabStrip = (LinearLayout) slidingTabIndicatorField.get(tabLayout);
+ for (int i = 0; i < mTabStrip.getChildCount(); i++) {
+ View tabView = mTabStrip.getChildAt(i);
+ //拿到tabView的mTextView属性
+ Field textViewField = tabView.getClass().getDeclaredField("textView");
+ textViewField.setAccessible(true);
+ TextView mTextView = (TextView) textViewField.get(tabView);
+ tabView.setPadding(0, 0, 0, 0);
+ // 因为想要的效果是字多宽线就多宽,所以测量mTextView的宽度
+ int width = mTextView.getWidth();
+ if (width == 0) {
+ mTextView.measure(0, 0);
+ width = mTextView.getMeasuredWidth();
+ }
+
+ mTextView.setWidth(tvWidth);
+
+ // 设置tab左右间距,注意这里不能使用Padding,因为源码中线的宽度是根据tabView的宽度来设置的
+ LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) tabView.getLayoutParams();
+ params.width = width;
+ params.leftMargin = margin;
+ params.rightMargin = margin;
+ tabView.setLayoutParams(params);
+ tabView.invalidate();
+ }
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+// tabLayout.post(new Runnable() {
+// @Override
+// public void run() {
+//
+// }
+// });
+ }
+
+ public static void setIndicatorWidth2(@NonNull final TabLayout tabLayout, final int margin) {
+ try {
+ // 拿到tabLayout的slidingTabIndicator属性
+ Field slidingTabIndicatorField = tabLayout.getClass().getDeclaredField("slidingTabIndicator");
+ slidingTabIndicatorField.setAccessible(true);
+ LinearLayout mTabStrip = (LinearLayout) slidingTabIndicatorField.get(tabLayout);
+ int left = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, margin, Resources.getSystem().getDisplayMetrics());
+ int right = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, margin, Resources.getSystem().getDisplayMetrics());
+ for (int i1 = 0; i1 < mTabStrip.getChildCount(); i1++) {
+ View child = mTabStrip.getChildAt(i1);
+ child.setPadding(0, 0, 0, 0);
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1);
+ params.leftMargin = left;
+ params.rightMargin = right;
+ child.setLayoutParams(params);
+ child.invalidate();
+ }
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+// tabLayout.post(new Runnable() {
+// @Override
+// public void run() {
+// setIndicatorWidth2(tabLayout, margin);
+// }
+// });
+ }
+
+
+ /**
+ * 加粗current
+ *
+ * @param tabLayout
+ * @param currentTab
+ */
+ public static void tabBoldCurrent(TabLayout tabLayout, TabLayout.Tab currentTab) {
+ int tabCount = tabLayout.getTabCount();
+ TabLayout.Tab tab;
+ for (int i = 0; i < tabCount; i++) {
+ tab = tabLayout.getTabAt(i);
+ TextView tv = getTextView(tab);
+ if (tv == null) {
+ continue;
+ }
+ tv.setTypeface(Typeface.DEFAULT);
+ }
+
+ TextView tv = getTextView(currentTab);
+ if (tv == null) {
+ return;
+ }
+ tv.setTypeface(Typeface.DEFAULT_BOLD);
+ }
+
+
+ public static void enableTabs(TabLayout tabLayout, Boolean enable) {
+ ViewGroup viewGroup = getTabViewGroup(tabLayout);
+ if (viewGroup != null)
+ for (int childIndex = 0; childIndex < viewGroup.getChildCount(); childIndex++) {
+ View tabView = viewGroup.getChildAt(childIndex);
+ if (tabView != null)
+ tabView.setEnabled(enable);
+ }
+ }
+
+ public static View getTabView(TabLayout tabLayout, int position) {
+ View tabView = null;
+ ViewGroup viewGroup = getTabViewGroup(tabLayout);
+ if (viewGroup != null && viewGroup.getChildCount() > position)
+ tabView = viewGroup.getChildAt(position);
+
+ return tabView;
+ }
+
+ private static ViewGroup getTabViewGroup(TabLayout tabLayout) {
+ ViewGroup viewGroup = null;
+
+ if (tabLayout != null && tabLayout.getChildCount() > 0) {
+ View view = tabLayout.getChildAt(0);
+ if (view != null && view instanceof ViewGroup)
+ viewGroup = (ViewGroup) view;
+ }
+ return viewGroup;
+ }
+}
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/ViewPagerSlide.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/ViewPagerSlide.java
new file mode 100644
index 00000000..a701bf5e
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/ViewPagerSlide.java
@@ -0,0 +1,78 @@
+package com.example.libbase.widgets;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+
+import androidx.viewpager.widget.ViewPager;
+
+public class ViewPagerSlide extends ViewPager {
+ private boolean isScroll;
+
+ public ViewPagerSlide(Context context) {
+ super(context);
+ }
+
+ public ViewPagerSlide(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ /**
+ * 1.dispatchTouchEvent一般情况不做处理
+ * ,如果修改了默认的返回值,子孩子都无法收到事件
+ */
+ @Override
+ public boolean dispatchTouchEvent(MotionEvent ev) {
+ return super.dispatchTouchEvent(ev); // return true;不行
+ }
+
+ /**
+ * 是否拦截
+ * 拦截:会走到自己的onTouchEvent方法里面来
+ * 不拦截:事件传递给子孩子
+ */
+ @Override
+ public boolean onInterceptTouchEvent(MotionEvent ev) {
+ // return false;//可行,不拦截事件,
+ // return true;//不行,孩子无法处理事件
+ //return super.onInterceptTouchEvent(ev);//不行,会有细微移动
+ try {
+ if (isScroll) {
+ return super.onInterceptTouchEvent(ev);
+ } else {
+ return false;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * 是否消费事件
+ * 消费:事件就结束
+ * 不消费:往父控件传
+ */
+ @Override
+ public boolean onTouchEvent(MotionEvent ev) {
+ //return false;// 可行,不消费,传给父控件
+ //return true;// 可行,消费,拦截事件
+ //super.onTouchEvent(ev); //不行,
+ //虽然onInterceptTouchEvent中拦截了,
+ //但是如果viewpage里面子控件不是viewgroup,还是会调用这个方法.
+ try {
+ if (isScroll) {
+ return super.onTouchEvent(ev);
+ } else {
+ return true;// 可行,消费,拦截事件
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return true;
+ }
+ }
+
+ public void setScroll(boolean scroll) {
+ isScroll = scroll;
+ }
+}
diff --git a/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/XRecyclerView.java b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/XRecyclerView.java
new file mode 100644
index 00000000..f1d6978c
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/java/com/example/libbase/widgets/XRecyclerView.java
@@ -0,0 +1,70 @@
+package com.example.libbase.widgets;
+
+import android.content.Context;
+import android.util.AttributeSet;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.bumptech.glide.Glide;
+
+public class XRecyclerView extends RecyclerView {
+ public XRecyclerView(Context context) {
+ this(context, null);
+ }
+
+ public XRecyclerView(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public XRecyclerView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ init();
+ }
+
+ private void init() {
+ addOnScrollListener(new ImageAutoLoadScrollListener());
+ }
+
+ //监听滚动来对图片加载进行判断处理
+ public class ImageAutoLoadScrollListener extends OnScrollListener{
+
+ @Override
+ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+ super.onScrolled(recyclerView, dx, dy);
+ }
+
+ @Override
+ public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+ super.onScrollStateChanged(recyclerView, newState);
+ switch (newState){
+ case SCROLL_STATE_IDLE: // The RecyclerView is not currently scrolling.
+ //当屏幕停止滚动,加载图片
+ try {
+ if(getContext() != null) Glide.with(getContext()).resumeRequests();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ break;
+ case SCROLL_STATE_DRAGGING: // The RecyclerView is currently being dragged by outside input such as user touch input.
+ //当屏幕滚动且用户使用的触碰或手指还在屏幕上,停止加载图片
+ try {
+ if(getContext() != null) Glide.with(getContext()).pauseRequests();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ break;
+ case SCROLL_STATE_SETTLING: // The RecyclerView is currently animating to a final position while not under outside control.
+ //由于用户的操作,屏幕产生惯性滑动,停止加载图片
+ try {
+ if(getContext() != null) Glide.with(getContext()).pauseRequests();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/res/drawable-xhdpi/empty_ready.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/empty_ready.png
new file mode 100644
index 00000000..b4335f16
Binary files /dev/null and b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/empty_ready.png differ
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/ic_back.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_back.png
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/ic_back.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_back.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_01.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_01.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_01.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_01.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_02.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_02.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_02.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_02.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_03.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_03.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_03.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_03.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_04.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_04.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_04.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_04.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_05.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_05.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_05.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_05.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_06.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_06.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_06.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_06.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_07.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_07.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_07.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_07.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_08.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_08.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_08.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_08.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_09.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_09.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_09.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_09.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_10.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_10.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_10.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_10.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_11.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_11.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_11.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_11.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_12.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_12.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/ic_loading_white1_12.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_loading_white1_12.png
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/ic_web_back.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_web_back.png
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/ic_web_back.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_web_back.png
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/ic_web_close.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_web_close.png
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/ic_web_close.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/ic_web_close.png
diff --git a/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_jiantou3.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_jiantou3.png
new file mode 100644
index 00000000..9c6de1b1
Binary files /dev/null and b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_jiantou3.png differ
diff --git a/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_jiantou5.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_jiantou5.png
new file mode 100644
index 00000000..ff864df2
Binary files /dev/null and b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_jiantou5.png differ
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/icon_web_back.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_web_back.png
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/icon_web_back.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_web_back.png
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/icon_web_close.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_web_close.png
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/icon_web_close.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/icon_web_close.png
diff --git a/commonlibs/common/libbase/src/main/res/drawable-xhdpi/nocontent2.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/nocontent2.png
new file mode 100644
index 00000000..79e505b7
Binary files /dev/null and b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/nocontent2.png differ
diff --git a/commonlibs/common/libbase/src/main/res/drawable-xhdpi/nowifi2.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/nowifi2.png
new file mode 100644
index 00000000..dbcf37a9
Binary files /dev/null and b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/nowifi2.png differ
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/pop_ad_delete3.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/pop_ad_delete3.png
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable-xhdpi/pop_ad_delete3.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/pop_ad_delete3.png
diff --git a/commonlibs/common/libbase/src/main/res/drawable-xhdpi/slb_run1.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/slb_run1.png
new file mode 100644
index 00000000..0f1fcd42
Binary files /dev/null and b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/slb_run1.png differ
diff --git a/commonlibs/common/libbase/src/main/res/drawable-xhdpi/slb_run2.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/slb_run2.png
new file mode 100644
index 00000000..c7cf4fd7
Binary files /dev/null and b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/slb_run2.png differ
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/smartbar_back_icon.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/smartbar_back_icon.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/smartbar_back_icon.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/smartbar_back_icon.png
diff --git a/commonlibs/baselibrary/src/main/res/drawable-hdpi/smartbar_home_icon.png b/commonlibs/common/libbase/src/main/res/drawable-xhdpi/smartbar_home_icon.png
similarity index 100%
rename from commonlibs/baselibrary/src/main/res/drawable-hdpi/smartbar_home_icon.png
rename to commonlibs/common/libbase/src/main/res/drawable-xhdpi/smartbar_home_icon.png
diff --git a/commonlibs/common/libbase/src/main/res/drawable/iv_loading_animationlist.xml b/commonlibs/common/libbase/src/main/res/drawable/iv_loading_animationlist.xml
new file mode 100644
index 00000000..5c766edc
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/drawable/iv_loading_animationlist.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/res/drawable/iv_loading_animationlist_slb.xml b/commonlibs/common/libbase/src/main/res/drawable/iv_loading_animationlist_slb.xml
new file mode 100644
index 00000000..09828b80
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/drawable/iv_loading_animationlist_slb.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/res/drawable/notice_dialog_bgbase.xml b/commonlibs/common/libbase/src/main/res/drawable/notice_dialog_bgbase.xml
new file mode 100644
index 00000000..65fc73e7
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/drawable/notice_dialog_bgbase.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_base_common_content1.xml b/commonlibs/common/libbase/src/main/res/layout/activity_base_common_content1.xml
similarity index 77%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_base_common_content1.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_base_common_content1.xml
index 13d20b0e..de07d213 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_base_common_content1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_base_common_content1.xml
@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/f5f5f5"
+ android:background="#f5f5f5"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
@@ -19,11 +19,11 @@
android:id="@+id/baserecycleview_smart_header1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:layout_srlBackgroundColor="@color/color_E6F1FF"
- app:srlAccentColor="@color/color_4DA3FE"
- app:srlPrimaryColor="@color/color_E6F1FF" />
+ app:layout_srlBackgroundColor="#E6F1FF"
+ app:srlAccentColor="#4DA3FE"
+ app:srlPrimaryColor="#E6F1FF" />
-
@@ -33,9 +33,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_srlBackgroundColor="@color/color_E6F1FF"
+ app:layout_srlBackgroundColor="#E6F1FF"
app:srlAccentColor="@color/white"
- app:srlPrimaryColor="@color/color_E6F1FF" />
+ app:srlPrimaryColor="#E6F1FF" />
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_base_common_index1.xml b/commonlibs/common/libbase/src/main/res/layout/activity_base_common_index1.xml
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_base_common_index1.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_base_common_index1.xml
index e49e7719..af83e2ef 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_base_common_index1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_base_common_index1.xml
@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/f5f5f5"
+ android:background="#f5f5f5"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_content1.xml b/commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_content1.xml
similarity index 94%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_content1.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_content1.xml
index 8f9faed6..2b3cd937 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_content1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_content1.xml
@@ -7,7 +7,7 @@
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
-
-
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_index1.xml b/commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_index1.xml
similarity index 93%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_index1.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_index1.xml
index 887e7c36..911e3639 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_index1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_index1.xml
@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/f5f5f5"
+ android:background="#f5f5f5"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_topbar1.xml b/commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_topbar1.xml
similarity index 96%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_topbar1.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_topbar1.xml
index cdc2fc9f..e8fa1dfb 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_baseviewpage_common_topbar1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_baseviewpage_common_topbar1.xml
@@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="0mm"
android:layout_weight="1"
- android:background="@color/blue357CD4">
+ android:background="#357CD4">
+ android:background="#E1E1E1" />
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_basics_display_webview.xml b/commonlibs/common/libbase/src/main/res/layout/activity_basics_display_webview.xml
similarity index 100%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_basics_display_webview.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_basics_display_webview.xml
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_js_webview.xml b/commonlibs/common/libbase/src/main/res/layout/activity_js_webview.xml
similarity index 93%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_js_webview.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_js_webview.xml
index c7b0672c..20764561 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_js_webview.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_js_webview.xml
@@ -19,7 +19,7 @@
android:layout_marginLeft="20dp"
android:layout_marginTop="30dp"
android:layout_marginRight="20dp"
- android:background="@color/blue"
+ android:background="#455ede"
android:text="调用Js,无参数方法"
android:textAllCaps="false"
android:textColor="@color/white"
@@ -32,7 +32,7 @@
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
- android:background="@color/blue"
+ android:background="#455ede"
android:text="调用Js,一个参数方法"
android:textAllCaps="false"
android:textColor="@color/white"
@@ -45,7 +45,7 @@
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
- android:background="@color/blue"
+ android:background="#455ede"
android:text="调用Js,多个参数方法"
android:textAllCaps="false"
android:textColor="@color/white"
@@ -59,7 +59,7 @@
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="30dp"
- android:background="@color/blue"
+ android:background="#455ede"
android:text="Android-Js-Android"
android:textAllCaps="false"
android:textColor="@color/white"
diff --git a/commonlibs/common/libbase/src/main/res/layout/activity_network_loading.xml b/commonlibs/common/libbase/src/main/res/layout/activity_network_loading.xml
new file mode 100644
index 00000000..37353da7
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_network_loading.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_refresh_webview.xml b/commonlibs/common/libbase/src/main/res/layout/activity_refresh_webview.xml
similarity index 96%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_refresh_webview.xml
rename to commonlibs/common/libbase/src/main/res/layout/activity_refresh_webview.xml
index 2f192ee9..f9732692 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/activity_refresh_webview.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/activity_refresh_webview.xml
@@ -15,7 +15,7 @@
app:srlAccentColor="@android:color/white"
app:srlEnableHeaderTranslationContent="false"
app:srlEnablePreviewInEditMode="false"
- app:srlPrimaryColor="@color/colorPrimary">
+ app:srlPrimaryColor="#3F51B5">
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/commonlibs/common/libbase/src/main/res/layout/empty_loading.xml b/commonlibs/common/libbase/src/main/res/layout/empty_loading.xml
new file mode 100644
index 00000000..7d5f7246
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/layout/empty_loading.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/res/layout/empty_nodata.xml b/commonlibs/common/libbase/src/main/res/layout/empty_nodata.xml
new file mode 100644
index 00000000..5740cc25
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/layout/empty_nodata.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_baseviewpage_common_fragment1.xml b/commonlibs/common/libbase/src/main/res/layout/fragment_baseviewpage_common_fragment1.xml
similarity index 100%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_baseviewpage_common_fragment1.xml
rename to commonlibs/common/libbase/src/main/res/layout/fragment_baseviewpage_common_fragment1.xml
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_baseviewpage_common_fragment1_item1.xml b/commonlibs/common/libbase/src/main/res/layout/fragment_baseviewpage_common_fragment1_item1.xml
similarity index 73%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_baseviewpage_common_fragment1_item1.xml
rename to commonlibs/common/libbase/src/main/res/layout/fragment_baseviewpage_common_fragment1_item1.xml
index b8694de7..e8d92cf5 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_baseviewpage_common_fragment1_item1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/fragment_baseviewpage_common_fragment1_item1.xml
@@ -1,5 +1,5 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_newitem1.xml b/commonlibs/common/libbase/src/main/res/layout/fragment_newitem1.xml
similarity index 92%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_newitem1.xml
rename to commonlibs/common/libbase/src/main/res/layout/fragment_newitem1.xml
index 76cb2cbf..75b0a455 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragment_newitem1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/fragment_newitem1.xml
@@ -2,7 +2,7 @@
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragmentyewulist1_common1.xml b/commonlibs/common/libbase/src/main/res/layout/fragmentyewulist1_common1.xml
similarity index 74%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragmentyewulist1_common1.xml
rename to commonlibs/common/libbase/src/main/res/layout/fragmentyewulist1_common1.xml
index ee195bbd..40fa4c23 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/fragmentyewulist1_common1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/fragmentyewulist1_common1.xml
@@ -7,24 +7,13 @@
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/recycleview_hxkt_tablayout_item1.xml b/commonlibs/common/libbase/src/main/res/layout/recycleview_hxkt_tablayout_item1.xml
similarity index 87%
rename from yewulibs1/yewulibs1-appcomm/src/main/res/layout/recycleview_hxkt_tablayout_item1.xml
rename to commonlibs/common/libbase/src/main/res/layout/recycleview_hxkt_tablayout_item1.xml
index 9d1ce4fe..5b394ad2 100644
--- a/yewulibs1/yewulibs1-appcomm/src/main/res/layout/recycleview_hxkt_tablayout_item1.xml
+++ b/commonlibs/common/libbase/src/main/res/layout/recycleview_hxkt_tablayout_item1.xml
@@ -1,11 +1,9 @@
+ android:orientation="vertical">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/res/values/colors.xml b/commonlibs/common/libbase/src/main/res/values/colors.xml
new file mode 100644
index 00000000..f25038b0
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/values/colors.xml
@@ -0,0 +1,14 @@
+
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+ #00000000
+ #ffffff
+ #000000
+ #55AAFF
+ #999999
+ #333333
+
+
diff --git a/commonlibs/common/libbase/src/main/res/values/dimens.xml b/commonlibs/common/libbase/src/main/res/values/dimens.xml
new file mode 100644
index 00000000..07d0b7c4
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/values/dimens.xml
@@ -0,0 +1,3 @@
+
+ 12dp
+
diff --git a/commonlibs/common/libbase/src/main/res/values/ids.xml b/commonlibs/common/libbase/src/main/res/values/ids.xml
new file mode 100644
index 00000000..fb59a4e9
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/values/ids.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commonlibs/common/libbase/src/main/res/values/strings.xml b/commonlibs/common/libbase/src/main/res/values/strings.xml
new file mode 100644
index 00000000..b7d6fb51
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+ libwebview
+
+ 重试
+
+
+
diff --git a/commonlibs/common/libbase/src/main/res/values/styles.xml b/commonlibs/common/libbase/src/main/res/values/styles.xml
new file mode 100644
index 00000000..d4522774
--- /dev/null
+++ b/commonlibs/common/libbase/src/main/res/values/styles.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
diff --git a/commonlibs/hunheku/libappjpushshare/.gitignore b/commonlibs/common/libglide47/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libappjpushshare/.gitignore
rename to commonlibs/common/libglide47/.gitignore
diff --git a/commonlibs/hunheku/libglide47/build.gradle b/commonlibs/common/libglide47/build.gradle
similarity index 64%
rename from commonlibs/hunheku/libglide47/build.gradle
rename to commonlibs/common/libglide47/build.gradle
index d0b4fc0a..637bea3f 100644
--- a/commonlibs/hunheku/libglide47/build.gradle
+++ b/commonlibs/common/libglide47/build.gradle
@@ -5,7 +5,7 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
// glide47
implementation librarys.glide47
implementation librarys.glide47AnnProcessor
@@ -14,13 +14,6 @@ dependencies {
implementation librarys.photoView
//解决Glide找不到Android声明库问题
annotationProcessor 'androidx.annotation:annotation:1.2.0'
- //
implementation 'com.github.getActivity:XXPermissions:11.0'
-// implementation 'com.lxj:xpermission:1.0.0'
-// implementation(name: 'libutils', ext: 'aar')
- //
-// implementation "com.squareup.okhttp3:okhttp:4.5.0"
-// implementation "com.squareup.okhttp3:logging-interceptor:4.5.0"
-// implementation "com.squareup.okio:okio:2.6.0"
}
diff --git a/commonlibs/hunheku/libglide47/proguard-rules.pro b/commonlibs/common/libglide47/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/libglide47/proguard-rules.pro
rename to commonlibs/common/libglide47/proguard-rules.pro
diff --git a/commonlibs/hunheku/libglide47/src/main/AndroidManifest.xml b/commonlibs/common/libglide47/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/AndroidManifest.xml
rename to commonlibs/common/libglide47/src/main/AndroidManifest.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/GlideMainActivity.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/GlideMainActivity.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/GlideMainActivity.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/GlideMainActivity.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityalluse.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityalluse.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityalluse.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityalluse.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityjiugongge.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityjiugongge.java
similarity index 97%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityjiugongge.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityjiugongge.java
index fa8e5d3b..ce0877d2 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityjiugongge.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/GlideMainActivityjiugongge.java
@@ -1,7 +1,7 @@
package com.geek.libglide47;
import android.os.Bundle;
-//import android.support.annotation.Nullable;
+//
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.TextView;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/CircleImageView.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/CircleImageView.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/CircleImageView.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/CircleImageView.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/GlideImageLoader.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/GlideImageLoader.java
similarity index 99%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/GlideImageLoader.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/GlideImageLoader.java
index 9e0fe0a3..81e78c28 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/GlideImageLoader.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/GlideImageLoader.java
@@ -6,7 +6,7 @@
import android.os.Handler;
import android.os.Looper;
//import android.support.annotation.DrawableRes;
-//import android.support.annotation.Nullable;
+//
import android.widget.ImageView;
import androidx.annotation.DrawableRes;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/GlideImageView.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/GlideImageView.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/GlideImageView.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/GlideImageView.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/GlideRoundImageView.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/GlideRoundImageView.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/GlideRoundImageView.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/GlideRoundImageView.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/RoundImageView.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/RoundImageView.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/RoundImageView.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/RoundImageView.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/ShapeImageView.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/ShapeImageView.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/ShapeImageView.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/ShapeImageView.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/CircleProgressView.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/CircleProgressView.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/CircleProgressView.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/CircleProgressView.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/OnGlideImageViewListener.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/OnGlideImageViewListener.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/OnGlideImageViewListener.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/OnGlideImageViewListener.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/OnProgressListener.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/OnProgressListener.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/OnProgressListener.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/OnProgressListener.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressAppGlideModule.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressAppGlideModule.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressAppGlideModule.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressAppGlideModule.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressManager.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressManager.java
similarity index 98%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressManager.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressManager.java
index 30014d91..6bfc70db 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressManager.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressManager.java
@@ -1,6 +1,6 @@
package com.geek.libglide47.base.progress;
-//import android.support.annotation.NonNull;
+//
import androidx.annotation.NonNull;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressResponseBody.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressResponseBody.java
similarity index 97%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressResponseBody.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressResponseBody.java
index 5cc64069..62db272c 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressResponseBody.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/progress/ProgressResponseBody.java
@@ -1,6 +1,6 @@
package com.geek.libglide47.base.progress;
-//import android.support.annotation.NonNull;
+//
import androidx.annotation.NonNull;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/transformation/GlideCircleTransformation.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/transformation/GlideCircleTransformation.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/transformation/GlideCircleTransformation.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/transformation/GlideCircleTransformation.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/util/DisplayUtil.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/util/DisplayUtil.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/base/util/DisplayUtil.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/base/util/DisplayUtil.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/adapter/ImagesAdapter.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/adapter/ImagesAdapter.java
similarity index 99%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/adapter/ImagesAdapter.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/adapter/ImagesAdapter.java
index be347ea4..26eb9b20 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/adapter/ImagesAdapter.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/adapter/ImagesAdapter.java
@@ -2,7 +2,7 @@
import android.content.Context;
import android.graphics.drawable.Drawable;
-//import android.support.annotation.NonNull;
+//
//import androidx.core.view.PagerAdapter;
import android.text.TextUtils;
import android.util.SparseArray;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewAdapter.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewAdapter.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewAdapter.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewAdapter.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewEventAdapter.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewEventAdapter.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewEventAdapter.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/adapter/NineImageViewEventAdapter.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ColorUtil.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ColorUtil.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ColorUtil.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ColorUtil.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/GlideRadomUtil.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/GlideRadomUtil.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/GlideRadomUtil.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/GlideRadomUtil.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ModelUtil.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ModelUtil.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ModelUtil.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/ModelUtil.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/StatusBarUtil.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/StatusBarUtil.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/StatusBarUtil.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/commonutil/StatusBarUtil.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageAttr.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageAttr.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageAttr.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageAttr.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageModel.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageModel.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageModel.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/domain/ImageModel.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/FixedViewPager.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/FixedViewPager.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/FixedViewPager.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/FixedViewPager.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/ImagesActivity.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/ImagesActivity.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/ImagesActivity.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/ImagesActivity.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImageActivity.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImageActivity.java
similarity index 98%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImageActivity.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImageActivity.java
index d8e471c6..f849771c 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImageActivity.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImageActivity.java
@@ -1,7 +1,7 @@
package com.geek.libglide47.demo.imageutil;
import android.os.Bundle;
-//import android.support.annotation.Nullable;
+//
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.appcompat.app.AppCompatActivity;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImagePhotoViewActivity.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImagePhotoViewActivity.java
similarity index 98%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImagePhotoViewActivity.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImagePhotoViewActivity.java
index a58f2a68..97ad0e33 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImagePhotoViewActivity.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/imageutil/SingleImagePhotoViewActivity.java
@@ -1,7 +1,7 @@
package com.geek.libglide47.demo.imageutil;
import android.os.Bundle;
-//import android.support.annotation.Nullable;
+//
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.appcompat.app.AppCompatActivity;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/view/ImageViewWrapper.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/view/ImageViewWrapper.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/view/ImageViewWrapper.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/view/ImageViewWrapper.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/view/NineImageView.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/view/NineImageView.java
similarity index 99%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/view/NineImageView.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/view/NineImageView.java
index fd68a7e6..776ce3c5 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/demo/view/NineImageView.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/demo/view/NineImageView.java
@@ -3,8 +3,8 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
-//import android.support.annotation.NonNull;
-//import android.support.annotation.Nullable;
+//
+//
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/CommonTarget.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/CommonTarget.java
similarity index 95%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/CommonTarget.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/CommonTarget.java
index e131479a..24612f3f 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/CommonTarget.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/CommonTarget.java
@@ -1,8 +1,8 @@
package com.geek.libglide47.glide48;
import android.graphics.drawable.Drawable;
-//import android.support.annotation.NonNull;
-//import android.support.annotation.Nullable;
+//
+//
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageHeaderParser.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageHeaderParser.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageHeaderParser.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageHeaderParser.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageLoaderUtils.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageLoaderUtils.java
similarity index 99%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageLoaderUtils.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageLoaderUtils.java
index 2fa2970b..d93b886f 100644
--- a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageLoaderUtils.java
+++ b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageLoaderUtils.java
@@ -27,7 +27,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-//import android.support.annotation.NonNull;
+//
public class Glide48ImageLoaderUtils {
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageType.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageType.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageType.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/Glide48ImageType.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/GlideAppUtils.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/GlideAppUtils.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/GlideAppUtils.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/GlideAppUtils.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/LXImageLoaderOnclick.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/LXImageLoaderOnclick.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/LXImageLoaderOnclick.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/LXImageLoaderOnclick.java
diff --git a/commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/LxImageLoader.java b/commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/LxImageLoader.java
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/java/com/geek/libglide47/glide48/LxImageLoader.java
rename to commonlibs/common/libglide47/src/main/java/com/geek/libglide47/glide48/LxImageLoader.java
diff --git a/commonlibs/hunheku/libglide47/src/main/res/drawable/gif_robot_walk.gif b/commonlibs/common/libglide47/src/main/res/drawable/gif_robot_walk.gif
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/drawable/gif_robot_walk.gif
rename to commonlibs/common/libglide47/src/main/res/drawable/gif_robot_walk.gif
diff --git a/commonlibs/hunheku/libglide47/src/main/res/drawable/ic_defs_loading.9.png b/commonlibs/common/libglide47/src/main/res/drawable/ic_defs_loading.9.png
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/drawable/ic_defs_loading.9.png
rename to commonlibs/common/libglide47/src/main/res/drawable/ic_defs_loading.9.png
diff --git a/commonlibs/hunheku/libglide47/src/main/res/drawable/ic_launcher_background.xml b/commonlibs/common/libglide47/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/drawable/ic_launcher_background.xml
rename to commonlibs/common/libglide47/src/main/res/drawable/ic_launcher_background.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image.xml b/commonlibs/common/libglide47/src/main/res/layout/activity_demo_image.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image.xml
rename to commonlibs/common/libglide47/src/main/res/layout/activity_demo_image.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_item_photoview.xml b/commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_item_photoview.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_item_photoview.xml
rename to commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_item_photoview.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_preview.xml b/commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_preview.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_preview.xml
rename to commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_preview.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_yulan.xml b/commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_yulan.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_yulan.xml
rename to commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_yulan.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_yulan2.xml b/commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_yulan2.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_image_yulan2.xml
rename to commonlibs/common/libglide47/src/main/res/layout/activity_demo_image_yulan2.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_main.xml b/commonlibs/common/libglide47/src/main/res/layout/activity_demo_main.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_main.xml
rename to commonlibs/common/libglide47/src/main/res/layout/activity_demo_main.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_main_glide.xml b/commonlibs/common/libglide47/src/main/res/layout/activity_demo_main_glide.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/layout/activity_demo_main_glide.xml
rename to commonlibs/common/libglide47/src/main/res/layout/activity_demo_main_glide.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/mipmap-hdpi/ic_launcher.png b/commonlibs/common/libglide47/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/mipmap-hdpi/ic_launcher.png
rename to commonlibs/common/libglide47/src/main/res/mipmap-hdpi/ic_launcher.png
diff --git a/commonlibs/hunheku/libglide47/src/main/res/mipmap-hdpi/ic_launcher_round.png b/commonlibs/common/libglide47/src/main/res/mipmap-hdpi/ic_launcher_round.png
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/mipmap-hdpi/ic_launcher_round.png
rename to commonlibs/common/libglide47/src/main/res/mipmap-hdpi/ic_launcher_round.png
diff --git a/commonlibs/hunheku/libglide47/src/main/res/values/attrs.xml b/commonlibs/common/libglide47/src/main/res/values/attrs.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/values/attrs.xml
rename to commonlibs/common/libglide47/src/main/res/values/attrs.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/values/colors.xml b/commonlibs/common/libglide47/src/main/res/values/colors.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/values/colors.xml
rename to commonlibs/common/libglide47/src/main/res/values/colors.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/values/dimens.xml b/commonlibs/common/libglide47/src/main/res/values/dimens.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/values/dimens.xml
rename to commonlibs/common/libglide47/src/main/res/values/dimens.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/values/strings.xml b/commonlibs/common/libglide47/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/values/strings.xml
rename to commonlibs/common/libglide47/src/main/res/values/strings.xml
diff --git a/commonlibs/hunheku/libglide47/src/main/res/values/style.xml b/commonlibs/common/libglide47/src/main/res/values/style.xml
similarity index 100%
rename from commonlibs/hunheku/libglide47/src/main/res/values/style.xml
rename to commonlibs/common/libglide47/src/main/res/values/style.xml
diff --git a/commonlibs/hunheku/libglide47/.gitignore b/commonlibs/common/libmvp/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libglide47/.gitignore
rename to commonlibs/common/libmvp/.gitignore
diff --git a/commonlibs/hunheku/libmvp/build.gradle b/commonlibs/common/libmvp/build.gradle
similarity index 100%
rename from commonlibs/hunheku/libmvp/build.gradle
rename to commonlibs/common/libmvp/build.gradle
diff --git a/commonlibs/hunheku/libmvp/proguard-rules.pro b/commonlibs/common/libmvp/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/libmvp/proguard-rules.pro
rename to commonlibs/common/libmvp/proguard-rules.pro
diff --git a/commonlibs/hunheku/libmvp/src/main/AndroidManifest.xml b/commonlibs/common/libmvp/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/hunheku/libmvp/src/main/AndroidManifest.xml
rename to commonlibs/common/libmvp/src/main/AndroidManifest.xml
diff --git a/commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/IView.java b/commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/IView.java
similarity index 100%
rename from commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/IView.java
rename to commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/IView.java
diff --git a/commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/Presenter.java b/commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/Presenter.java
similarity index 100%
rename from commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/Presenter.java
rename to commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/Presenter.java
diff --git a/commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/PresenterHelper.java b/commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/PresenterHelper.java
similarity index 100%
rename from commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/PresenterHelper.java
rename to commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/mvp/PresenterHelper.java
diff --git a/commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/readme.java b/commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/readme.java
similarity index 100%
rename from commonlibs/hunheku/libmvp/src/main/java/com/haier/cellarette/libmvp/readme.java
rename to commonlibs/common/libmvp/src/main/java/com/haier/cellarette/libmvp/readme.java
diff --git a/commonlibs/hunheku/libmvp/src/main/res/values/strings.xml b/commonlibs/common/libmvp/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libmvp/src/main/res/values/strings.xml
rename to commonlibs/common/libmvp/src/main/res/values/strings.xml
diff --git a/commonlibs/hunheku/libmvp/.gitignore b/commonlibs/common/librararyforfileprovdider/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libmvp/.gitignore
rename to commonlibs/common/librararyforfileprovdider/.gitignore
diff --git a/commonlibs/hunheku/librararyforfileprovdider/build.gradle b/commonlibs/common/librararyforfileprovdider/build.gradle
similarity index 78%
rename from commonlibs/hunheku/librararyforfileprovdider/build.gradle
rename to commonlibs/common/librararyforfileprovdider/build.gradle
index 266287c0..27ff23d3 100644
--- a/commonlibs/hunheku/librararyforfileprovdider/build.gradle
+++ b/commonlibs/common/librararyforfileprovdider/build.gradle
@@ -5,5 +5,5 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
}
diff --git a/commonlibs/hunheku/librararyforfileprovdider/proguard-rules.pro b/commonlibs/common/librararyforfileprovdider/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/proguard-rules.pro
rename to commonlibs/common/librararyforfileprovdider/proguard-rules.pro
diff --git a/commonlibs/hunheku/librararyforfileprovdider/src/main/AndroidManifest.xml b/commonlibs/common/librararyforfileprovdider/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/src/main/AndroidManifest.xml
rename to commonlibs/common/librararyforfileprovdider/src/main/AndroidManifest.xml
diff --git a/commonlibs/hunheku/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/AndroidFileUtil.java b/commonlibs/common/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/AndroidFileUtil.java
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/AndroidFileUtil.java
rename to commonlibs/common/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/AndroidFileUtil.java
diff --git a/commonlibs/hunheku/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/Appuri.java b/commonlibs/common/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/Appuri.java
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/Appuri.java
rename to commonlibs/common/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/Appuri.java
diff --git a/commonlibs/hunheku/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/FileProvider7.java b/commonlibs/common/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/FileProvider7.java
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/FileProvider7.java
rename to commonlibs/common/librararyforfileprovdider/src/main/java/com/zhy/base/fileprovider/FileProvider7.java
diff --git a/commonlibs/hunheku/librararyforfileprovdider/src/main/res/values/strings.xml b/commonlibs/common/librararyforfileprovdider/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/src/main/res/values/strings.xml
rename to commonlibs/common/librararyforfileprovdider/src/main/res/values/strings.xml
diff --git a/commonlibs/hunheku/librararyforfileprovdider/src/main/res/xml/file_paths.xml b/commonlibs/common/librararyforfileprovdider/src/main/res/xml/file_paths.xml
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/src/main/res/xml/file_paths.xml
rename to commonlibs/common/librararyforfileprovdider/src/main/res/xml/file_paths.xml
diff --git a/commonlibs/hunheku/librararyforfileprovdider/.gitignore b/commonlibs/common/libretrofit/.gitignore
similarity index 100%
rename from commonlibs/hunheku/librararyforfileprovdider/.gitignore
rename to commonlibs/common/libretrofit/.gitignore
diff --git a/commonlibs/hunheku/libretrofit/build.gradle b/commonlibs/common/libretrofit/build.gradle
similarity index 92%
rename from commonlibs/hunheku/libretrofit/build.gradle
rename to commonlibs/common/libretrofit/build.gradle
index bc44eea2..878ee82a 100644
--- a/commonlibs/hunheku/libretrofit/build.gradle
+++ b/commonlibs/common/libretrofit/build.gradle
@@ -14,7 +14,7 @@ dependencies {
api librarys.okhttploggerinter
api librarys.gsonJson
api librarys.fastJson
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
//
// implementation "com.squareup.okhttp3:okhttp:4.5.0"
// implementation "com.squareup.okhttp3:logging-interceptor:4.5.0"
diff --git a/commonlibs/hunheku/libretrofit/proguard-rules.pro b/commonlibs/common/libretrofit/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/libretrofit/proguard-rules.pro
rename to commonlibs/common/libretrofit/proguard-rules.pro
diff --git a/commonlibs/hunheku/libretrofit/src/main/AndroidManifest.xml b/commonlibs/common/libretrofit/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/AndroidManifest.xml
rename to commonlibs/common/libretrofit/src/main/AndroidManifest.xml
diff --git a/commonlibs/hunheku/libretrofit/src/main/assets/shujuzidian.doc b/commonlibs/common/libretrofit/src/main/assets/shujuzidian.doc
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/assets/shujuzidian.doc
rename to commonlibs/common/libretrofit/src/main/assets/shujuzidian.doc
diff --git a/commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/BanbenUtils.java b/commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/BanbenUtils.java
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/BanbenUtils.java
rename to commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/BanbenUtils.java
diff --git a/commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/LoggingInterceptor.java b/commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/LoggingInterceptor.java
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/LoggingInterceptor.java
rename to commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/LoggingInterceptor.java
diff --git a/commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean.java b/commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean.java
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean.java
rename to commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean.java
diff --git a/commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean1.java b/commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean1.java
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean1.java
rename to commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/ResponseSlbBean1.java
diff --git a/commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/RetrofitNetNew.java b/commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/RetrofitNetNew.java
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/RetrofitNetNew.java
rename to commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/common/RetrofitNetNew.java
diff --git a/commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/test.java b/commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/test.java
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/java/com/haier/cellarette/libretrofit/test.java
rename to commonlibs/common/libretrofit/src/main/java/com/haier/cellarette/libretrofit/test.java
diff --git a/commonlibs/hunheku/libretrofit/src/main/res/values/strings.xml b/commonlibs/common/libretrofit/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libretrofit/src/main/res/values/strings.xml
rename to commonlibs/common/libretrofit/src/main/res/values/strings.xml
diff --git a/commonlibs/hunheku/libretrofit/.gitignore b/commonlibs/common/libswipebacklayout/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libretrofit/.gitignore
rename to commonlibs/common/libswipebacklayout/.gitignore
diff --git a/commonlibs/yewulibs/slbswipebacklayout/build.gradle b/commonlibs/common/libswipebacklayout/build.gradle
similarity index 78%
rename from commonlibs/yewulibs/slbswipebacklayout/build.gradle
rename to commonlibs/common/libswipebacklayout/build.gradle
index 6c3e5c9e..15f3af42 100644
--- a/commonlibs/yewulibs/slbswipebacklayout/build.gradle
+++ b/commonlibs/common/libswipebacklayout/build.gradle
@@ -5,5 +5,5 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
}
diff --git a/commonlibs/common/libswipebacklayout/consumer-rules.pro b/commonlibs/common/libswipebacklayout/consumer-rules.pro
new file mode 100644
index 00000000..e69de29b
diff --git a/commonlibs/hunheku/libutils/proguard-rules.pro b/commonlibs/common/libswipebacklayout/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/libutils/proguard-rules.pro
rename to commonlibs/common/libswipebacklayout/proguard-rules.pro
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/AndroidManifest.xml b/commonlibs/common/libswipebacklayout/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/AndroidManifest.xml
rename to commonlibs/common/libswipebacklayout/src/main/AndroidManifest.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBack.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBack.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBack.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBack.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackLayout.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackLayout.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackLayout.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackLayout.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackUtil.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackUtil.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackUtil.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/SwipeBackUtil.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/ViewDragHelper.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/ViewDragHelper.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/ViewDragHelper.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/ViewDragHelper.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivity.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivity.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivity.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivity.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityBase.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityBase.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityBase.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityBase.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityHelper.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityHelper.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityHelper.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackActivityHelper.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackListenerActivityAdapter.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackListenerActivityAdapter.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackListenerActivityAdapter.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackListenerActivityAdapter.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackPreferenceActivity.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackPreferenceActivity.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackPreferenceActivity.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/activity/SwipeBackPreferenceActivity.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/demo/PreferenceUtils.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/demo/PreferenceUtils.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/demo/PreferenceUtils.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/demo/PreferenceUtils.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/demo/SwipebacklayoutDemoActivity.java b/commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/demo/SwipebacklayoutDemoActivity.java
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/java/com/example/swipebacklayout/demo/SwipebacklayoutDemoActivity.java
rename to commonlibs/common/libswipebacklayout/src/main/java/com/example/swipebacklayout/demo/SwipebacklayoutDemoActivity.java
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/drawable-xhdpi/shadow_bottom.png b/commonlibs/common/libswipebacklayout/src/main/res/drawable-xhdpi/shadow_bottom.png
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/drawable-xhdpi/shadow_bottom.png
rename to commonlibs/common/libswipebacklayout/src/main/res/drawable-xhdpi/shadow_bottom.png
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/drawable-xhdpi/shadow_left.png b/commonlibs/common/libswipebacklayout/src/main/res/drawable-xhdpi/shadow_left.png
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/drawable-xhdpi/shadow_left.png
rename to commonlibs/common/libswipebacklayout/src/main/res/drawable-xhdpi/shadow_left.png
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/drawable-xhdpi/shadow_right.png b/commonlibs/common/libswipebacklayout/src/main/res/drawable-xhdpi/shadow_right.png
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/drawable-xhdpi/shadow_right.png
rename to commonlibs/common/libswipebacklayout/src/main/res/drawable-xhdpi/shadow_right.png
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/layout/swipeback_layout.xml b/commonlibs/common/libswipebacklayout/src/main/res/layout/swipeback_layout.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/layout/swipeback_layout.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/layout/swipeback_layout.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/layout/swipeback_layout_demo.xml b/commonlibs/common/libswipebacklayout/src/main/res/layout/swipeback_layout_demo.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/layout/swipeback_layout_demo.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/layout/swipeback_layout_demo.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/menu/main.xml b/commonlibs/common/libswipebacklayout/src/main/res/menu/main.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/menu/main.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/menu/main.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/attrs.xml b/commonlibs/common/libswipebacklayout/src/main/res/values/attrs.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/attrs.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/values/attrs.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/color.xml b/commonlibs/common/libswipebacklayout/src/main/res/values/color.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/color.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/values/color.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/dimens.xml b/commonlibs/common/libswipebacklayout/src/main/res/values/dimens.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/dimens.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/values/dimens.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/strings.xml b/commonlibs/common/libswipebacklayout/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/strings.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/values/strings.xml
diff --git a/commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/styles.xml b/commonlibs/common/libswipebacklayout/src/main/res/values/styles.xml
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/src/main/res/values/styles.xml
rename to commonlibs/common/libswipebacklayout/src/main/res/values/styles.xml
diff --git a/commonlibs/hunheku/libutils/.gitignore b/commonlibs/common/libutils/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libutils/.gitignore
rename to commonlibs/common/libutils/.gitignore
diff --git a/commonlibs/hunheku/libutils/build.gradle b/commonlibs/common/libutils/build.gradle
similarity index 72%
rename from commonlibs/hunheku/libutils/build.gradle
rename to commonlibs/common/libutils/build.gradle
index 6e6af49e..3c47aef7 100644
--- a/commonlibs/hunheku/libutils/build.gradle
+++ b/commonlibs/common/libutils/build.gradle
@@ -23,9 +23,16 @@ dependencies {
api librarys.autosize
api librarys.mmkv
api librarys.viewpager2
- api 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9
- api 'com.tencent.bugly:nativecrashreport:latest.release' //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0
-
+ api 'com.tencent.bugly:crashreport:latest.release'
+ //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9
+ api 'com.tencent.bugly:nativecrashreport:latest.release'
+ //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0
+ // https://github.com/airbnb/lottie-android
+ api 'com.airbnb.android:lottie:3.4.2'
+ // https://github.com/Meituan-Dianping/walle
+ api 'com.meituan.android.walle:library:1.1.7'
+ // https://www.pgyer.com/doc/view/android-sdk
+ api 'com.pgyer:analytics:4.1.16'
// implementation "androidx.legacy:legacy-support-v4:1.0.0"
// implementation "androidx.appcompat:appcompat:1.2.0"
diff --git a/commonlibs/hunheku/libwebview/proguard-rules.pro b/commonlibs/common/libutils/proguard-rules.pro
similarity index 100%
rename from commonlibs/hunheku/libwebview/proguard-rules.pro
rename to commonlibs/common/libutils/proguard-rules.pro
diff --git a/commonlibs/hunheku/libutils/src/main/AndroidManifest.xml b/commonlibs/common/libutils/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/AndroidManifest.xml
rename to commonlibs/common/libutils/src/main/AndroidManifest.xml
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/ConstantsUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/ConstantsUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/ConstantsUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/ConstantsUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/SlbLoginUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/SlbLoginUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/SlbLoginUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/SlbLoginUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/BaseApp.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/BaseApp.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/BaseApp.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/BaseApp.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/BaseAppManager.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/BaseAppManager.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/BaseAppManager.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/BaseAppManager.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/BaseViewHelper.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/BaseViewHelper.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/BaseViewHelper.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/BaseViewHelper.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ClickUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ClickUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ClickUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ClickUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/CrashHandler.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/CrashHandler.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/CrashHandler.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/CrashHandler.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/EmojiStringUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/EmojiStringUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/EmojiStringUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/EmojiStringUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/FragmentHelper.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/FragmentHelper.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/FragmentHelper.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/FragmentHelper.java
diff --git a/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/LocalBroadcastManagers.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/LocalBroadcastManagers.java
new file mode 100644
index 00000000..cdb5ab6f
--- /dev/null
+++ b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/LocalBroadcastManagers.java
@@ -0,0 +1,267 @@
+package com.geek.libutils.app;
+
+import android.annotation.SuppressLint;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Set;
+
+/**
+ * Created by efan on 2017/4/14.
+ */
+
+public final class LocalBroadcastManagers {
+ private static final String TAG = "LocalBroadcastManagers";
+ private static final boolean DEBUG = false;
+ private final Context mAppContext;
+ private final HashMap> mReceivers = new HashMap>();
+ private final HashMap> mActions = new HashMap>();
+ private final ArrayList mPendingBroadcasts = new ArrayList();
+ static final int MSG_EXEC_PENDING_BROADCASTS = 1;
+ private final Handler mHandler;
+ private static final Object mLock = new Object();
+ private static volatile LocalBroadcastManagers mInstance;
+
+ public static LocalBroadcastManagers getInstance(Context context) {
+ Object var1 = mLock;
+ synchronized (mLock) {
+ if (mInstance == null) {
+ mInstance = new LocalBroadcastManagers(context.getApplicationContext());
+// mInstance = new AgentWebAgentWebLocalBroadcastManagers(context);
+ }
+
+ return mInstance;
+ }
+ }
+
+ private LocalBroadcastManagers(Context context) {
+ this.mAppContext = context;
+ this.mHandler = new Handler(context.getMainLooper()) {
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case 1:
+ LocalBroadcastManagers.this.executePendingBroadcasts();
+ break;
+ default:
+ super.handleMessage(msg);
+ }
+
+ }
+ };
+ }
+
+ public void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
+ HashMap var3 = this.mReceivers;
+ synchronized (this.mReceivers) {
+ LocalBroadcastManagers.ReceiverRecord entry = new LocalBroadcastManagers.ReceiverRecord(filter, receiver);
+ ArrayList filters = this.mReceivers.get(receiver);
+ if (filters == null) {
+ filters = new ArrayList(1);
+ this.mReceivers.put(receiver, filters);
+ }
+
+ filters.add(filter);
+
+ for (int i = 0; i < filter.countActions(); ++i) {
+ String action = filter.getAction(i);
+ ArrayList entries = this.mActions.get(action);
+ if (entries == null) {
+ entries = new ArrayList(1);
+ this.mActions.put(action, entries);
+ }
+
+ entries.add(entry);
+ }
+
+ }
+ }
+
+ public void unregisterReceiver(BroadcastReceiver receiver) {
+ HashMap var2 = this.mReceivers;
+ synchronized (this.mReceivers) {
+ ArrayList filters = this.mReceivers.remove(receiver);
+ if (filters != null) {
+ for (int i = 0; i < filters.size(); ++i) {
+ IntentFilter filter = (IntentFilter) filters.get(i);
+
+ for (int j = 0; j < filter.countActions(); ++j) {
+ String action = filter.getAction(j);
+ ArrayList receivers = this.mActions.get(action);
+ if (receivers != null) {
+ for (int k = 0; k < receivers.size(); ++k) {
+ if (((LocalBroadcastManagers.ReceiverRecord) receivers.get(k)).receiver == receiver) {
+ receivers.remove(k);
+ --k;
+ }
+ }
+
+ if (receivers.size() <= 0) {
+ this.mActions.remove(action);
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ @SuppressLint("LongLogTag")
+ public boolean sendBroadcast(Intent intent) {
+ HashMap var2 = this.mReceivers;
+ synchronized (this.mReceivers) {
+ String action = intent.getAction();
+ String type = intent.resolveTypeIfNeeded(this.mAppContext.getContentResolver());
+ Uri data = intent.getData();
+ String scheme = intent.getScheme();
+ Set categories = intent.getCategories();
+ boolean debug = (intent.getFlags() & 8) != 0;
+ if (debug) {
+ Log.v("AgentWebLocalBroadcastManagers", "Resolving type " + type + " scheme " + scheme + " of intent " + intent);
+ }
+
+ ArrayList entries = this.mActions.get(intent.getAction());
+ if (entries != null) {
+ if (debug) {
+ Log.v("AgentWebLocalBroadcastManagers", "Action list: " + entries);
+ }
+
+ ArrayList receivers = null;
+
+ int i;
+ for (i = 0; i < entries.size(); ++i) {
+ LocalBroadcastManagers.ReceiverRecord receiver = (LocalBroadcastManagers.ReceiverRecord) entries.get(i);
+ if (debug) {
+ Log.v("AgentWebAgentWebLocalBroadcastManagers", "Matching against filter " + receiver.filter);
+ }
+
+ if (receiver.broadcasting) {
+ if (debug) {
+ Log.v("AgentWebAgentWebLocalBroadcastManagers", " Filter\'s target already added");
+ }
+ } else {
+ int match = receiver.filter.match(action, type, scheme, data, categories, "AgentWebAgentWebLocalBroadcastManagers");
+ if (match >= 0) {
+ if (debug) {
+ Log.v("AgentWebAgentWebLocalBroadcastManagers", " Filter matched! match=0x" + Integer.toHexString(match));
+ }
+
+ if (receivers == null) {
+ receivers = new ArrayList();
+ }
+
+ receivers.add(receiver);
+ receiver.broadcasting = true;
+ } else if (debug) {
+ String reason;
+ switch (match) {
+ case -4:
+ reason = "category";
+ break;
+ case -3:
+ reason = "action";
+ break;
+ case -2:
+ reason = "data";
+ break;
+ case -1:
+ reason = "type";
+ break;
+ default:
+ reason = "unknown reason";
+ }
+
+ Log.v("AgentWebAgentWebLocalBroadcastManagers", " Filter did not match: " + reason);
+ }
+ }
+ }
+
+ if (receivers != null) {
+ for (i = 0; i < receivers.size(); ++i) {
+ ((LocalBroadcastManagers.ReceiverRecord) receivers.get(i)).broadcasting = false;
+ }
+
+ this.mPendingBroadcasts.add(new LocalBroadcastManagers.BroadcastRecord(intent, receivers));
+ if (!this.mHandler.hasMessages(1)) {
+ this.mHandler.sendEmptyMessage(1);
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ public void sendBroadcastSync(Intent intent) {
+ if (this.sendBroadcast(intent)) {
+ this.executePendingBroadcasts();
+ }
+
+ }
+
+ private void executePendingBroadcasts() {
+ while (true) {
+ LocalBroadcastManagers.BroadcastRecord[] brs = null;
+ HashMap i = this.mReceivers;
+ synchronized (this.mReceivers) {
+ int br = this.mPendingBroadcasts.size();
+ if (br <= 0) {
+ return;
+ }
+
+ brs = new LocalBroadcastManagers.BroadcastRecord[br];
+ this.mPendingBroadcasts.toArray(brs);
+ this.mPendingBroadcasts.clear();
+ }
+
+ for (int var6 = 0; var6 < brs.length; ++var6) {
+ LocalBroadcastManagers.BroadcastRecord var7 = brs[var6];
+
+ for (int j = 0; j < var7.receivers.size(); ++j) {
+ var7.receivers.get(j).receiver.onReceive(this.mAppContext, var7.intent);
+ }
+ }
+ }
+ }
+
+ private static class BroadcastRecord {
+ final Intent intent;
+ final ArrayList receivers;
+
+ BroadcastRecord(Intent _intent, ArrayList _receivers) {
+ this.intent = _intent;
+ this.receivers = _receivers;
+ }
+ }
+
+ private static class ReceiverRecord {
+ final IntentFilter filter;
+ final BroadcastReceiver receiver;
+ boolean broadcasting;
+
+ ReceiverRecord(IntentFilter _filter, BroadcastReceiver _receiver) {
+ this.filter = _filter;
+ this.receiver = _receiver;
+ }
+
+ public String toString() {
+ StringBuilder builder = new StringBuilder(128);
+ builder.append("Receiver{");
+ builder.append(this.receiver);
+ builder.append(" filter=");
+ builder.append(this.filter);
+ builder.append("}");
+ return builder.toString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/MobileUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/MobileUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/MobileUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/MobileUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/MyLogUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/MyLogUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/MyLogUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/MyLogUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/NetAccessHelper.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/NetAccessHelper.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/NetAccessHelper.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/NetAccessHelper.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ShellExeUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ShellExeUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ShellExeUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ShellExeUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/StatusBarUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/StatusBarUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/StatusBarUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/StatusBarUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/StatusBarUtilV7.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/StatusBarUtilV7.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/StatusBarUtilV7.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/StatusBarUtilV7.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ViewHelper.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ViewHelper.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ViewHelper.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ViewHelper.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ViewHolder.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ViewHolder.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/app/ViewHolder.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/app/ViewHolder.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/BitmapUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/BitmapUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/BitmapUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/BitmapUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/CodeUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/CodeUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/CodeUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/CodeUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/DataFormatUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/DataFormatUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/DataFormatUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/DataFormatUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/DataTransferUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/DataTransferUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/DataTransferUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/DataTransferUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/DemoMMKVBean.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/DemoMMKVBean.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/DemoMMKVBean.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/DemoMMKVBean.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/IoUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/IoUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/IoUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/IoUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/LocationUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/LocationUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/LocationUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/LocationUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/MmkvUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/MmkvUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/MmkvUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/MmkvUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/SerializeUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/SerializeUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/SerializeUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/SerializeUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/StringUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/StringUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/StringUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/StringUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/ToStringUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/data/ToStringUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/data/ToStringUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/data/ToStringUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/BrightnessTools.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/device/BrightnessTools.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/BrightnessTools.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/device/BrightnessTools.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/DeviceUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/device/DeviceUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/DeviceUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/device/DeviceUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/DvAppUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/device/DvAppUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/DvAppUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/device/DvAppUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/SdcardUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/device/SdcardUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/device/SdcardUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/device/SdcardUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/DateUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/DateUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/DateUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/DateUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/SeekbarChangeAdapter.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/SeekbarChangeAdapter.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/SeekbarChangeAdapter.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/SeekbarChangeAdapter.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/TimeManager.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/TimeManager.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/TimeManager.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/TimeManager.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/TimeUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/TimeUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/etc/TimeUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/etc/TimeUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/jiami/EncryptUtils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/jiami/EncryptUtils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/jiami/EncryptUtils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/jiami/EncryptUtils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/jiami/JiamiCommonUtil.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/jiami/JiamiCommonUtil.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/jiami/JiamiCommonUtil.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/jiami/JiamiCommonUtil.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/jiami/Md5Utils.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/jiami/Md5Utils.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/jiami/Md5Utils.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/jiami/Md5Utils.java
diff --git a/commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/test.java b/commonlibs/common/libutils/src/main/java/com/geek/libutils/test.java
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/java/com/geek/libutils/test.java
rename to commonlibs/common/libutils/src/main/java/com/geek/libutils/test.java
diff --git a/commonlibs/hunheku/libutils/src/main/res/drawable-nodpi/default_unknow_image.png b/commonlibs/common/libutils/src/main/res/drawable-nodpi/default_unknow_image.png
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/drawable-nodpi/default_unknow_image.png
rename to commonlibs/common/libutils/src/main/res/drawable-nodpi/default_unknow_image.png
diff --git a/commonlibs/hunheku/libutils/src/main/res/drawable/bg_network.xml b/commonlibs/common/libutils/src/main/res/drawable/bg_network.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/drawable/bg_network.xml
rename to commonlibs/common/libutils/src/main/res/drawable/bg_network.xml
diff --git a/commonlibs/hunheku/libutils/src/main/res/drawable/shape_toast_background.xml b/commonlibs/common/libutils/src/main/res/drawable/shape_toast_background.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/drawable/shape_toast_background.xml
rename to commonlibs/common/libutils/src/main/res/drawable/shape_toast_background.xml
diff --git a/commonlibs/hunheku/libutils/src/main/res/layout/layout_progress_dialog.xml b/commonlibs/common/libutils/src/main/res/layout/layout_progress_dialog.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/layout/layout_progress_dialog.xml
rename to commonlibs/common/libutils/src/main/res/layout/layout_progress_dialog.xml
diff --git a/commonlibs/hunheku/libutils/src/main/res/layout/layout_toast_network.xml b/commonlibs/common/libutils/src/main/res/layout/layout_toast_network.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/layout/layout_toast_network.xml
rename to commonlibs/common/libutils/src/main/res/layout/layout_toast_network.xml
diff --git a/commonlibs/hunheku/libutils/src/main/res/mipmap-xhdpi/im_bang.png b/commonlibs/common/libutils/src/main/res/mipmap-xhdpi/im_bang.png
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/mipmap-xhdpi/im_bang.png
rename to commonlibs/common/libutils/src/main/res/mipmap-xhdpi/im_bang.png
diff --git a/commonlibs/hunheku/libutils/src/main/res/mipmap-xhdpi/progress_dialog.png b/commonlibs/common/libutils/src/main/res/mipmap-xhdpi/progress_dialog.png
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/mipmap-xhdpi/progress_dialog.png
rename to commonlibs/common/libutils/src/main/res/mipmap-xhdpi/progress_dialog.png
diff --git a/commonlibs/hunheku/libutils/src/main/res/values/ids.xml b/commonlibs/common/libutils/src/main/res/values/ids.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/values/ids.xml
rename to commonlibs/common/libutils/src/main/res/values/ids.xml
diff --git a/commonlibs/hunheku/libutils/src/main/res/values/strings.xml b/commonlibs/common/libutils/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/values/strings.xml
rename to commonlibs/common/libutils/src/main/res/values/strings.xml
diff --git a/commonlibs/hunheku/libutils/src/main/res/values/styles.xml b/commonlibs/common/libutils/src/main/res/values/styles.xml
similarity index 100%
rename from commonlibs/hunheku/libutils/src/main/res/values/styles.xml
rename to commonlibs/common/libutils/src/main/res/values/styles.xml
diff --git a/commonlibs/hunheku/libwebview/.gitignore b/commonlibs/common/libwebview/.gitignore
similarity index 100%
rename from commonlibs/hunheku/libwebview/.gitignore
rename to commonlibs/common/libwebview/.gitignore
diff --git a/commonlibs/hunheku/libwebview/build.gradle b/commonlibs/common/libwebview/build.gradle
similarity index 78%
rename from commonlibs/hunheku/libwebview/build.gradle
rename to commonlibs/common/libwebview/build.gradle
index 11fe749d..6c28bf1f 100644
--- a/commonlibs/hunheku/libwebview/build.gradle
+++ b/commonlibs/common/libwebview/build.gradle
@@ -5,6 +5,6 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
}
diff --git "a/commonlibs/hunheku/libwebview/doc/HIOS\345\215\217\350\256\256\350\267\263\350\275\2543.0.txt" "b/commonlibs/common/libwebview/doc/HIOS\345\215\217\350\256\256\350\267\263\350\275\2543.0.txt"
similarity index 100%
rename from "commonlibs/hunheku/libwebview/doc/HIOS\345\215\217\350\256\256\350\267\263\350\275\2543.0.txt"
rename to "commonlibs/common/libwebview/doc/HIOS\345\215\217\350\256\256\350\267\263\350\275\2543.0.txt"
diff --git "a/commonlibs/hunheku/libwebview/doc/URI\350\267\263\350\275\254\345\216\237\347\224\237\346\212\200\346\234\257\345\215\217\350\256\256 V1.5(1).docx" "b/commonlibs/common/libwebview/doc/URI\350\267\263\350\275\254\345\216\237\347\224\237\346\212\200\346\234\257\345\215\217\350\256\256 V1.5(1).docx"
similarity index 100%
rename from "commonlibs/hunheku/libwebview/doc/URI\350\267\263\350\275\254\345\216\237\347\224\237\346\212\200\346\234\257\345\215\217\350\256\256 V1.5(1).docx"
rename to "commonlibs/common/libwebview/doc/URI\350\267\263\350\275\254\345\216\237\347\224\237\346\212\200\346\234\257\345\215\217\350\256\256 V1.5(1).docx"
diff --git "a/commonlibs/hunheku/libwebview/doc/\350\257\267\346\261\202\346\240\274\345\274\217\345\217\212\346\225\260\346\215\256\345\255\227\345\205\270V3.0.xlsx" "b/commonlibs/common/libwebview/doc/\350\257\267\346\261\202\346\240\274\345\274\217\345\217\212\346\225\260\346\215\256\345\255\227\345\205\270V3.0.xlsx"
similarity index 100%
rename from "commonlibs/hunheku/libwebview/doc/\350\257\267\346\261\202\346\240\274\345\274\217\345\217\212\346\225\260\346\215\256\345\255\227\345\205\270V3.0.xlsx"
rename to "commonlibs/common/libwebview/doc/\350\257\267\346\261\202\346\240\274\345\274\217\345\217\212\346\225\260\346\215\256\345\255\227\345\205\270V3.0.xlsx"
diff --git a/commonlibs/yewulibs/slbswipebacklayout/proguard-rules.pro b/commonlibs/common/libwebview/proguard-rules.pro
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/proguard-rules.pro
rename to commonlibs/common/libwebview/proguard-rules.pro
diff --git a/commonlibs/hunheku/libwebview/src/main/AndroidManifest.xml b/commonlibs/common/libwebview/src/main/AndroidManifest.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/AndroidManifest.xml
rename to commonlibs/common/libwebview/src/main/AndroidManifest.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/assets/demo/test11.html b/commonlibs/common/libwebview/src/main/assets/demo/test11.html
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/assets/demo/test11.html
rename to commonlibs/common/libwebview/src/main/assets/demo/test11.html
diff --git a/commonlibs/hunheku/libwebview/src/main/assets/demo/web.html b/commonlibs/common/libwebview/src/main/assets/demo/web.html
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/assets/demo/web.html
rename to commonlibs/common/libwebview/src/main/assets/demo/web.html
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/Act.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/Act.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/Act.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/Act.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/DemoWebviewMainActivity.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/DemoWebviewMainActivity.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/DemoWebviewMainActivity.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/DemoWebviewMainActivity.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/HiosMainActivity.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/HiosMainActivity.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/HiosMainActivity.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/HiosMainActivity.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/NoHiosMainActivity.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/NoHiosMainActivity.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/NoHiosMainActivity.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/activity/NoHiosMainActivity.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/AdCommPart1Activity.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/AdCommPart1Activity.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/AdCommPart1Activity.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/AdCommPart1Activity.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebStatusBarUtil.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebStatusBarUtil.java
similarity index 99%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebStatusBarUtil.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebStatusBarUtil.java
index 6d13ba0d..c2587b15 100644
--- a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebStatusBarUtil.java
+++ b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebStatusBarUtil.java
@@ -25,7 +25,7 @@
//import android.support.annotation.ColorInt;
//import android.support.annotation.IntRange;
-//import android.support.annotation.NonNull;
+//
//import androidx.coordinatorlayout.widget.CoordinatorLayout;
//import androidx.core.widget.DrawerLayout;
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewActivity.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewActivity.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewActivity.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewActivity.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewMainActivity.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewMainActivity.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewMainActivity.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewMainActivity.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity2.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity2.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity2.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/base/WebViewPartActivity2.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/AdListItem.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/AdListItem.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/AdListItem.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/AdListItem.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/HiosRegister.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/HiosRegister.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/HiosRegister.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hioscommon/HiosRegister.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosAlias.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosAlias.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosAlias.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosAlias.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosHelper.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosHelper.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosHelper.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/HiosHelper.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/IntentFiller.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/IntentFiller.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/IntentFiller.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/IntentFiller.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/MapFiller.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/MapFiller.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/MapFiller.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/MapFiller.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/UriHelper.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/UriHelper.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/UriHelper.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/UriHelper.java
diff --git a/commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/WebView1Utils.java b/commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/WebView1Utils.java
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/WebView1Utils.java
rename to commonlibs/common/libwebview/src/main/java/com/haier/cellarette/libwebview/hois2/WebView1Utils.java
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable-mdpi/ic_web_title_bg.png b/commonlibs/common/libwebview/src/main/res/drawable-mdpi/ic_web_title_bg.png
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable-mdpi/ic_web_title_bg.png
rename to commonlibs/common/libwebview/src/main/res/drawable-mdpi/ic_web_title_bg.png
diff --git a/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_back.png b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_back.png
new file mode 100644
index 00000000..a6fe83c4
Binary files /dev/null and b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_back.png differ
diff --git a/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_web_back.png b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_web_back.png
new file mode 100644
index 00000000..41d6d6bb
Binary files /dev/null and b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_web_back.png differ
diff --git a/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_web_close.png b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_web_close.png
new file mode 100644
index 00000000..da2b5771
Binary files /dev/null and b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/ic_web_close.png differ
diff --git a/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/icon_web_back.png b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/icon_web_back.png
new file mode 100644
index 00000000..fe15db32
Binary files /dev/null and b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/icon_web_back.png differ
diff --git a/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/icon_web_close.png b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/icon_web_close.png
new file mode 100644
index 00000000..d90e74f3
Binary files /dev/null and b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/icon_web_close.png differ
diff --git a/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/pop_ad_delete3.png b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/pop_ad_delete3.png
new file mode 100644
index 00000000..9896ab4f
Binary files /dev/null and b/commonlibs/common/libwebview/src/main/res/drawable-xhdpi/pop_ad_delete3.png differ
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable/layer_list_progress_drawable.xml b/commonlibs/common/libwebview/src/main/res/drawable/layer_list_progress_drawable.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable/layer_list_progress_drawable.xml
rename to commonlibs/common/libwebview/src/main/res/drawable/layer_list_progress_drawable.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable/shape_progressbar_bg.xml b/commonlibs/common/libwebview/src/main/res/drawable/shape_progressbar_bg.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable/shape_progressbar_bg.xml
rename to commonlibs/common/libwebview/src/main/res/drawable/shape_progressbar_bg.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/drawable/shape_progressbar_progress.xml b/commonlibs/common/libwebview/src/main/res/drawable/shape_progressbar_progress.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/drawable/shape_progressbar_progress.xml
rename to commonlibs/common/libwebview/src/main/res/drawable/shape_progressbar_progress.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout-land/web_web_toolbar.xml b/commonlibs/common/libwebview/src/main/res/layout-land/web_web_toolbar.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout-land/web_web_toolbar.xml
rename to commonlibs/common/libwebview/src/main/res/layout-land/web_web_toolbar.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout/activity_adcommpart1.xml b/commonlibs/common/libwebview/src/main/res/layout/activity_adcommpart1.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout/activity_adcommpart1.xml
rename to commonlibs/common/libwebview/src/main/res/layout/activity_adcommpart1.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout/activity_main_two.xml b/commonlibs/common/libwebview/src/main/res/layout/activity_main_two.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout/activity_main_two.xml
rename to commonlibs/common/libwebview/src/main/res/layout/activity_main_two.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout/activity_webviewmain.xml b/commonlibs/common/libwebview/src/main/res/layout/activity_webviewmain.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout/activity_webviewmain.xml
rename to commonlibs/common/libwebview/src/main/res/layout/activity_webviewmain.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout/web_web_toolbar.xml b/commonlibs/common/libwebview/src/main/res/layout/web_web_toolbar.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout/web_web_toolbar.xml
rename to commonlibs/common/libwebview/src/main/res/layout/web_web_toolbar.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout/web_webview_layout.xml b/commonlibs/common/libwebview/src/main/res/layout/web_webview_layout.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout/web_webview_layout.xml
rename to commonlibs/common/libwebview/src/main/res/layout/web_webview_layout.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout/web_webview_part_layout.xml b/commonlibs/common/libwebview/src/main/res/layout/web_webview_part_layout.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout/web_webview_part_layout.xml
rename to commonlibs/common/libwebview/src/main/res/layout/web_webview_part_layout.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/layout/web_webview_part_layout2.xml b/commonlibs/common/libwebview/src/main/res/layout/web_webview_part_layout2.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/layout/web_webview_part_layout2.xml
rename to commonlibs/common/libwebview/src/main/res/layout/web_webview_part_layout2.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/values/colors.xml b/commonlibs/common/libwebview/src/main/res/values/colors.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/values/colors.xml
rename to commonlibs/common/libwebview/src/main/res/values/colors.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/values/ids.xml b/commonlibs/common/libwebview/src/main/res/values/ids.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/values/ids.xml
rename to commonlibs/common/libwebview/src/main/res/values/ids.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/values/strings.xml b/commonlibs/common/libwebview/src/main/res/values/strings.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/values/strings.xml
rename to commonlibs/common/libwebview/src/main/res/values/strings.xml
diff --git a/commonlibs/hunheku/libwebview/src/main/res/values/styles.xml b/commonlibs/common/libwebview/src/main/res/values/styles.xml
similarity index 100%
rename from commonlibs/hunheku/libwebview/src/main/res/values/styles.xml
rename to commonlibs/common/libwebview/src/main/res/values/styles.xml
diff --git a/commonlibs/dkplayer/dkplayer-java/build.gradle b/commonlibs/dkplayer/dkplayer-java/build.gradle
index 6c3e5c9e..15f3af42 100644
--- a/commonlibs/dkplayer/dkplayer-java/build.gradle
+++ b/commonlibs/dkplayer/dkplayer-java/build.gradle
@@ -5,5 +5,5 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
}
diff --git a/commonlibs/dkplayer/dkplayer-players/ijk/build.gradle b/commonlibs/dkplayer/dkplayer-players/ijk/build.gradle
index 3fedc3b1..4dc09154 100644
--- a/commonlibs/dkplayer/dkplayer-players/ijk/build.gradle
+++ b/commonlibs/dkplayer/dkplayer-players/ijk/build.gradle
@@ -5,7 +5,7 @@ apply from: './../../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
compileOnly project(':commonlibs:dkplayer:dkplayer-java')
}
\ No newline at end of file
diff --git a/commonlibs/dkplayer/dkplayer-players/ijkexo/build.gradle b/commonlibs/dkplayer/dkplayer-players/ijkexo/build.gradle
index df079738..098f1b73 100644
--- a/commonlibs/dkplayer/dkplayer-players/ijkexo/build.gradle
+++ b/commonlibs/dkplayer/dkplayer-players/ijkexo/build.gradle
@@ -6,6 +6,6 @@ apply from: './../../../../commonlibs4.gradle'
def librarys = rootProject.ext.dependencies //依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
compileOnly project(':commonlibs:dkplayer:dkplayer-java')
}
\ No newline at end of file
diff --git a/commonlibs/dkplayer/dkplayer-sample/build.gradle b/commonlibs/dkplayer/dkplayer-sample/build.gradle
index 79ce2fbd..3a60f967 100644
--- a/commonlibs/dkplayer/dkplayer-sample/build.gradle
+++ b/commonlibs/dkplayer/dkplayer-sample/build.gradle
@@ -6,7 +6,7 @@ def librarys = rootProject.ext.dependencies //依赖
//repositories { flatDir { dirs 'libs' } }
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
implementation project(':commonlibs:hunheku:libyanzhenjieandpermission')
// implementation 'com.yanzhenjie:permission:2.0.3'
implementation librarys.glide47
diff --git a/commonlibs/dkplayer/dkplayer-ui/build.gradle b/commonlibs/dkplayer/dkplayer-ui/build.gradle
index 0cf0d4fe..daf25a3c 100644
--- a/commonlibs/dkplayer/dkplayer-ui/build.gradle
+++ b/commonlibs/dkplayer/dkplayer-ui/build.gradle
@@ -5,6 +5,6 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
api project(':commonlibs:dkplayer:dkplayer-java')
}
\ No newline at end of file
diff --git a/commonlibs/dkplayer/dkplayer-videocache/build.gradle b/commonlibs/dkplayer/dkplayer-videocache/build.gradle
index 3bd9f03e..c269b98a 100644
--- a/commonlibs/dkplayer/dkplayer-videocache/build.gradle
+++ b/commonlibs/dkplayer/dkplayer-videocache/build.gradle
@@ -5,5 +5,5 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libZRecyclerView/build.gradle b/commonlibs/hunheku/libZRecyclerView/build.gradle
index 40f8e798..80419e1a 100644
--- a/commonlibs/hunheku/libZRecyclerView/build.gradle
+++ b/commonlibs/hunheku/libZRecyclerView/build.gradle
@@ -5,7 +5,7 @@ apply from: './../../../commonlibs1.gradle'
def librarys = rootProject.ext.dependencies //
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
implementation 'com.google.android:flexbox:2.0.1'
// implementation 'com.google.android.flexbox:flexbox:3.0.0'
}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebFragment.java b/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebFragment.java
deleted file mode 100644
index 98e88743..00000000
--- a/commonlibs/hunheku/libagentweb-core/src/main/java/com/just/agentweb/base/BaseAgentWebFragment.java
+++ /dev/null
@@ -1,198 +0,0 @@
-package com.just.agentweb.base;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.WebView;
-
-import androidx.annotation.ColorInt;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-
-import com.just.agentweb.AgentWeb;
-import com.just.agentweb.AgentWebSettingsImpl;
-import com.just.agentweb.AgentWebUIControllerImplBase;
-import com.just.agentweb.IAgentWebSettings;
-import com.just.agentweb.IWebLayout;
-import com.just.agentweb.MiddlewareWebChromeBase;
-import com.just.agentweb.MiddlewareWebClientBase;
-import com.just.agentweb.PermissionInterceptor;
-import com.just.agentweb.WebChromeClient;
-import com.just.agentweb.WebViewClient;
-
-/**
- * Created by cenxiaozhong on 2017/7/22.
- * source code https://github.com/Justson/AgentWeb
- */
-
-public abstract class BaseAgentWebFragment extends Fragment {
-
- protected AgentWeb mAgentWeb;
- private MiddlewareWebChromeBase mMiddleWareWebChrome;
- private MiddlewareWebClientBase mMiddleWareWebClient;
- private ErrorLayoutEntity mErrorLayoutEntity;
- private AgentWebUIControllerImplBase mAgentWebUIController;
-
-
- @Override
- public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
- if (getAgentWebParent() == null) {
- return;
- }
- mErrorLayoutEntity = getErrorLayoutEntity();
-// CoolIndicatorLayout mCoolIndicatorLayout = new CoolIndicatorLayout(this);
- mAgentWeb = AgentWeb.with(this)
- .setAgentWebParent(getAgentWebParent(), new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
- .useDefaultIndicator(getIndicatorColor(), getIndicatorHeight())
- .setWebChromeClient(getWebChromeClient())
- .setWebViewClient(getWebViewClient())
- .setWebView(getWebView())
- .setPermissionInterceptor(getPermissionInterceptor())
- .setWebLayout(getWebLayout())
- .setAgentWebUIController(getAgentWebUIController())
- .interceptUnkownUrl()
- .useMiddlewareWebChrome(getMiddleWareWebChrome())
- .useMiddlewareWebClient(getMiddleWareWebClient())
- .setAgentWebWebSettings(getAgentWebSettings())
- .setMainFrameErrorView(mErrorLayoutEntity.layoutRes, mErrorLayoutEntity.reloadId)
- .setSecurityType(AgentWeb.SecurityType.STRICT_CHECK)
- .createAgentWeb()
- .ready()
- .go(getUrl());
- super.onViewCreated(view, savedInstanceState);
- }
-
- protected void setTitle(WebView view, String title) {
-
- }
-
- protected @NonNull
- ErrorLayoutEntity getErrorLayoutEntity() {
- if (this.mErrorLayoutEntity == null) {
- this.mErrorLayoutEntity = new ErrorLayoutEntity();
- }
- return mErrorLayoutEntity;
- }
-
- protected @Nullable
- AgentWebUIControllerImplBase getAgentWebUIController() {
- return mAgentWebUIController;
- }
-
- protected static class ErrorLayoutEntity {
- private int layoutRes = com.just.agentweb.R.layout.agentweb_error_page;
- private int reloadId;
-
- public void setLayoutRes(int layoutRes) {
- this.layoutRes = layoutRes;
- if (layoutRes <= 0) {
- layoutRes = -1;
- }
- }
-
- public void setReloadId(int reloadId) {
- this.reloadId = reloadId;
- if (reloadId <= 0) {
- reloadId = -1;
- }
- }
- }
-
- @Override
- public void onPause() {
- if (mAgentWeb != null) {
- mAgentWeb.getWebLifeCycle().onPause();
- }
- super.onPause();
-
- }
-
- @Override
- public void onResume() {
- if (mAgentWeb != null) {
- mAgentWeb.getWebLifeCycle().onResume();
- }
- super.onResume();
- }
-
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- }
-
-
- protected @Nullable
- String getUrl() {
- return "";
- }
-
- @Override
- public void onDestroy() {
- if (mAgentWeb != null) {
- mAgentWeb.getWebLifeCycle().onDestroy();
- }
- super.onDestroy();
- }
-
- protected @Nullable
- IAgentWebSettings getAgentWebSettings() {
- return AgentWebSettingsImpl.getInstance();
- }
-
- protected @Nullable
- WebChromeClient getWebChromeClient() {
- return null;
- }
-
- protected abstract @NonNull
- ViewGroup getAgentWebParent();
-
- protected @ColorInt
- int getIndicatorColor() {
- return -1;
- }
-
- protected int getIndicatorHeight() {
- return -1;
- }
-
- protected @Nullable
- WebViewClient getWebViewClient() {
- return null;
- }
-
- protected @Nullable
- WebView getWebView() {
- return null;
- }
-
- protected @Nullable
- IWebLayout getWebLayout() {
- return null;
- }
-
- protected @Nullable
- PermissionInterceptor getPermissionInterceptor() {
- return null;
- }
-
- protected @NonNull
- MiddlewareWebChromeBase getMiddleWareWebChrome() {
- return this.mMiddleWareWebChrome = new MiddlewareWebChromeBase() {
- @Override
- public void onReceivedTitle(WebView view, String title) {
- super.onReceivedTitle(view, title);
- setTitle(view, title);
- }
- };
- }
-
- protected @NonNull
- MiddlewareWebClientBase getMiddleWareWebClient() {
- return this.mMiddleWareWebClient = new MiddlewareWebClientBase() {
- };
- }
-}
diff --git a/commonlibs/hunheku/libappjpushshare/build.gradle b/commonlibs/hunheku/libappjpushshare/build.gradle
deleted file mode 100644
index aa490ed9..00000000
--- a/commonlibs/hunheku/libappjpushshare/build.gradle
+++ /dev/null
@@ -1,19 +0,0 @@
-plugins {
- id 'com.android.library'
-}
-apply from: './../../../commonlibs1.gradle'
-def config = rootProject.ext //
-def librarys = rootProject.ext.dependencies //
-dependencies {
- implementation fileTree(include: ['*.jar'], dir: 'libs')
- //common url
- implementation librarys.glide47
- implementation project(':commonlibs:hunheku:libutils')
- api 'cn.jiguang.sdk:jcore:2.7.2' //
- api 'cn.jiguang.sdk:jshare:1.8.0' //
- api 'cn.jiguang.sdk:jshare-qqmodel:1.8.0' //
- api 'cn.jiguang.sdk:jshare-wechatmodel:1.8.0' //
-// api 'cn.jiguang.sdk:jshare-sinamodel:1.8.0' //
- //jar aar
- // /**rep*/implementation (name:'biz-identification_bxn_nation', ext:'aar')
-}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/AndroidManifest.xml b/commonlibs/hunheku/libappjpushshare/src/main/AndroidManifest.xml
deleted file mode 100644
index 35ca39df..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/assets/JGShareSDK.xml b/commonlibs/hunheku/libappjpushshare/src/main/assets/JGShareSDK.xml
deleted file mode 100644
index f015209a..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/assets/JGShareSDK.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/FaceBookUploadReceiver.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/FaceBookUploadReceiver.java
deleted file mode 100644
index 71af6556..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/FaceBookUploadReceiver.java
+++ /dev/null
@@ -1,25 +0,0 @@
-//package com.example.slbappshare;
-//
-//import android.os.Bundle;
-//
-//import cn.jiguang.share.android.utils.Logger;
-//import cn.jiguang.share.facebook.FacebookBroadcastReceiver;
-//
-///**
-// * Created by Ivanwu on 2017/8/8.
-// */
-//
-//public class FaceBookUploadReceiver extends FacebookBroadcastReceiver {
-//
-// private static final String TAG = "FaceBookUploadReceiver";
-//
-// @Override
-// protected void onSuccessfulAppCall(String appCallId, String action, Bundle extras) {
-// Logger.dd(TAG, String.format("Photo uploaded by call " + appCallId + " succeeded."));
-// }
-//
-// @Override
-// protected void onFailedAppCall(String appCallId, String action, Bundle extras) {
-// Logger.dd(TAG, String.format("Photo uploaded by call " + appCallId + " failed."));
-// }
-//}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/ShareIndexActivity.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/ShareIndexActivity.java
deleted file mode 100644
index 22dca625..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/ShareIndexActivity.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.example.slbappjpushshare;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.view.View;
-
-import androidx.annotation.Nullable;
-import androidx.core.app.ActivityCompat;
-
-import com.blankj.utilcode.util.AppUtils;
-import com.example.slbappjpushshare.fenxiang.JPushShareUtils;
-
-import cn.jiguang.share.android.api.JShareInterface;
-import cn.jiguang.share.android.api.Platform;
-import cn.jiguang.share.android.api.PlatformConfig;
-
-//import android.support.annotation.Nullable;
-
-public class ShareIndexActivity extends Activity {
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_shareindex);
- JShareInterface.setDebugMode(true);
- PlatformConfig platformConfig = new PlatformConfig()
- .setWechat(JPushShareUtils.APP_ID, JPushShareUtils.APP_KEY)// wxa3fa50c49fcd271c 746c2cd0f414de2c256c4f2095316bd0
- .setQQ("1106011004", "YIbPvONmBQBZUGaN")
- .setSinaWeibo("374535501", "baccd12c166f1df96736b51ffbf600a2", "https://www.jiguang.cn");
- JShareInterface.init(this, platformConfig);// android 10崩溃
-
-
- if (Build.VERSION.SDK_INT >= 23) {
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
- || ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
- ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, 0);
- }
- }
- }
-
-
- public void BTN1(View view) {
- //分享弹窗bufen
- Intent intent = new Intent(AppUtils.getAppPackageName() + ".hs.act.slbapp.ShareBottomActivity");
- intent.putExtra("type", Platform.ACTION_SHARE);//授权
- startActivity(intent);
- }
-
- public void BTN2(View view) {
- Intent intent = new Intent(AppUtils.getAppPackageName() + ".hs.act.slbapp.ShareIndex1Activity");
- intent.putExtra("type", Platform.ACTION_AUTHORIZING);//授权
- startActivity(intent);
- }
-
- public void BTN3(View view) {
- Intent intent = new Intent(AppUtils.getAppPackageName() + ".hs.act.slbapp.ShareIndex2Activity");
- intent.putExtra("type", Platform.ACTION_USER_INFO);//授权
- startActivity(intent);
- //
-
- }
-
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- }
-
-
- /**
- * --------------------------------业务逻辑分割线----------------------------------
- */
-
-
-}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/JPushDengluUtils.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/JPushDengluUtils.java
deleted file mode 100644
index 48e7b854..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/JPushDengluUtils.java
+++ /dev/null
@@ -1,228 +0,0 @@
-package com.example.slbappjpushshare.denglu;
-
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-
-import cn.jiguang.share.android.api.AuthListener;
-import cn.jiguang.share.android.api.JShareInterface;
-import cn.jiguang.share.android.api.Platform;
-import cn.jiguang.share.android.model.AccessTokenInfo;
-import cn.jiguang.share.android.model.BaseResponseInfo;
-import cn.jiguang.share.android.model.UserInfo;
-import cn.jiguang.share.android.utils.Logger;
-
-public class JPushDengluUtils {
-
- private static final String TAG = "JPushDengluUtils";
-
- private OnResultInfoLitener onResultInfoLitener;
-
- public JPushDengluUtils(OnResultInfoLitener onResultInfoLitener) {
- this.onResultInfoLitener = onResultInfoLitener;
-
- }
-
- private Handler mHandler = new Handler(new Handler.Callback() {
- @Override
- public boolean handleMessage(Message msg) {
-// String toastMsg = (String) msg.obj;
- Bundle b = msg.getData();
- String platform = b.getString("platform");
- String toastMsg = b.getString("toastMsg");
- String data = b.getString("data");
- if (onResultInfoLitener != null) {
- onResultInfoLitener.onResults(platform, toastMsg, data);
- }
-
- return false;
- }
- });
-
- /**
- * 设置授权+ 取消授权bufen
- *
- * @param name
- */
- public void shezhi_shouquan(String name) {
- if (!en_shouquan(name)) {
- shouquan(name);
- } else {
- shouquan_cancel(name);
- }
- }
-
- /**
- * 设置授权+ 获取个人信息bufen
- *
- * @param name
- */
- public void shezhi_shouquan_getinfo(String name) {
- JShareInterface.getUserInfo(name, mAuthListener);
- }
-
- /**
- * 销毁bufen
- */
- public void ondes() {
- if (mHandler != null) {
- mHandler.removeCallbacksAndMessages(null);
- mHandler = null;
- }
- }
-
- /**
- * 判断是否授权登录bufen
- *
- * @param name_platform
- */
- public boolean en_shouquan(String name_platform) {
- return JShareInterface.isAuthorize(name_platform);
- }
-
- /**
- * 授权登录bufen
- *
- * @param name_platform
- */
- public void shouquan(String name_platform) {
- if (!JShareInterface.isAuthorize(name_platform)) {
- JShareInterface.authorize(name_platform, mAuthListener);
- }
- }
-
- /**
- * 授权登录 取消bufen
- *
- * @param name_platform
- */
- public void shouquan_cancel(String name_platform) {
- if (JShareInterface.isAuthorize(name_platform)) {
- JShareInterface.removeAuthorize(name_platform, mAuthListener);
- }
- }
-
-
- /**
- * 授权、获取个人信息回调
- * action :Platform.ACTION_AUTHORIZING 授权
- * Platform.ACTION_USER_INFO 获取个人信息
- */
- public AuthListener mAuthListener = new AuthListener() {
- @Override
- public void onComplete(Platform platform, int action, BaseResponseInfo data) {
- Logger.dd(TAG, "onComplete:" + platform + ",action:" + action + ",data:" + data);
- String toastMsg = null;
- String originData = "";
- switch (action) {
- case Platform.ACTION_AUTHORIZING:
- if (data instanceof AccessTokenInfo) { //授权信息
- String token = ((AccessTokenInfo) data).getToken();//token
- long expiration = ((AccessTokenInfo) data).getExpiresIn();//token有效时间,时间戳
- String refresh_token = ((AccessTokenInfo) data).getRefeshToken();//refresh_token
- String openid = ((AccessTokenInfo) data).getOpenid();//openid
- //授权原始数据,开发者可自行处理
- originData = data.getOriginData();
-// toastMsg = "授权成功:" + data.toString();
- toastMsg = "授权成功:";
- Logger.dd(TAG, "openid:" + openid + ",token:" + token + ",expiration:" + expiration + ",refresh_token:" + refresh_token);
- Logger.dd(TAG, "originData:" + originData);
- }
- break;
- case Platform.ACTION_REMOVE_AUTHORIZING:
- toastMsg = "删除授权成功";
- break;
- case Platform.ACTION_USER_INFO:
- if (data instanceof UserInfo) { //第三方个人信息
- String openid = ((UserInfo) data).getOpenid(); //openid
- String name = ((UserInfo) data).getName(); //昵称
- String imageUrl = ((UserInfo) data).getImageUrl(); //头像url
- int gender = ((UserInfo) data).getGender();//性别, 1表示男性;2表示女性
- //个人信息原始数据,开发者可自行处理
- originData = data.getOriginData();
- toastMsg = "获取个人信息成功:";
-// toastMsg = "获取个人信息成功:" + data.toString();
- Logger.dd(TAG, "openid:" + openid + ",name:" + name + ",gender:" + gender + ",imageUrl:" + imageUrl);
- Logger.dd(TAG, "originData:" + originData);
- }
- break;
- }
- she_handler_msg(1, platform.getName(), toastMsg, originData);
- }
-
- @Override
- public void onError(Platform platform, int action, int errorCode, Throwable error) {
- Logger.dd(TAG, "onError:" + platform + ",action:" + action + ",error:" + error);
- String toastMsg = null;
- switch (action) {
- case Platform.ACTION_AUTHORIZING:
- toastMsg = "授权失败";
- break;
- case Platform.ACTION_REMOVE_AUTHORIZING:
- toastMsg = "删除授权失败";
- break;
- case Platform.ACTION_USER_INFO:
- toastMsg = "获取个人信息失败";
- break;
- }
- she_handler_msg(1, platform.getName(), toastMsg + (error != null ? error.getMessage() : "") + "---" + errorCode, "");
-
- }
-
- @Override
- public void onCancel(Platform platform, int action) {
- Logger.dd(TAG, "onCancel:" + platform + ",action:" + action);
- String toastMsg = null;
- switch (action) {
- case Platform.ACTION_AUTHORIZING:
- toastMsg = "取消授权";
- break;
- // TODO: 2017/6/23 删除授权不存在取消
- case Platform.ACTION_REMOVE_AUTHORIZING:
- break;
- case Platform.ACTION_USER_INFO:
- toastMsg = "取消获取个人信息";
- break;
- }
- she_handler_msg(1, platform.getName(), toastMsg, "");
-// if (handler != null) {
-// Message msg = handler.obtainMessage(3);
-// msg.obj = toastMsg;
-// msg.sendToTarget();
-// }
- }
- };
-
- private void she_handler_msg(int what, String platform, String toastMsg, String datas) {
- if (mHandler == null) {
- return;
- }
- Message msg = mHandler.obtainMessage(what);
-// msg.obj = data.toString();
- Bundle b = new Bundle();
- b.putString("platform", platform);
- b.putString("toastMsg", toastMsg);
- b.putString("data", datas);
- msg.setData(b);
- msg.sendToTarget();
- }
-
-// /**
-// * ItemClick的回调接口
-// *
-// * @author geek
-// */
-// public interface OnResultInfoLitener {
-// void onComplete(Platform platform, BaseResponseInfo data);
-// void onError(Platform platform, String toastMsg);
-// void onCancel(Platform platform, String toastMsg);
-// }
-//
-// private OnItemClickLitener mOnItemClickLitener;
-//
-// public void setOnItemClickLitener(OnItemClickLitener mOnItemClickLitener) {
-// this.mOnItemClickLitener = mOnItemClickLitener;
-// }
-
-
-}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/OnResultInfoLitener.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/OnResultInfoLitener.java
deleted file mode 100644
index 1e46ee5b..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/OnResultInfoLitener.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.example.slbappjpushshare.denglu;
-
-/**
- * 授权登录的回调接口
- *
- * @author geek
- */
-public interface OnResultInfoLitener {
- void onResults(String platform, String toastMsg, String data);
-}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/ShareIndex1Activity.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/ShareIndex1Activity.java
deleted file mode 100644
index 9e33637c..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/ShareIndex1Activity.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.example.slbappjpushshare.denglu;
-
-import android.app.Activity;
-import android.os.Bundle;
-//import android.support.annotation.Nullable;
-import android.view.View;
-import android.widget.Button;
-import android.widget.Toast;
-
-import androidx.annotation.Nullable;
-
-import com.example.slbappjpushshare.R;
-
-import cn.jiguang.share.android.api.Platform;
-import cn.jiguang.share.qqmodel.QQ;
-import cn.jiguang.share.wechat.Wechat;
-
-public class ShareIndex1Activity extends Activity implements View.OnClickListener, OnResultInfoLitener {
-
- private String TAG = this.getClass().getSimpleName();
- private Button btn1;
- private Button btn2;
- private Button btn3;
- private JPushDengluUtils JPushDengluUtils;
-
- private int type;
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_shareindex1);
- findview();
- onclick();
- donetwork();
- }
-
- private void donetwork() {
- type = getIntent().getIntExtra("type", Platform.ACTION_SHARE);
- JPushDengluUtils = new JPushDengluUtils(this);
-// platformList = JShareInterface.getPlatformList();
- if (type == Platform.ACTION_AUTHORIZING) {
- if (JPushDengluUtils.en_shouquan(QQ.Name)) {
- btn1.setText(QQ.Name + "已授权");
- }
- if (JPushDengluUtils.en_shouquan(Wechat.Name)) {
- btn2.setText(Wechat.Name + "已授权");
- }
-// if (JPushDengluUtils.en_shouquan(SinaWeibo.Name)) {
-// btn3.setText(SinaWeibo.Name + "已授权");
-// }
- }
-
-
- }
-
- @Override
- public void onClick(View v) {
- int i = v.getId();
- if (i == R.id.btn1) {
- set_qq();
- } else if (i == R.id.btn2) {
- set_weixin();
- } else if (i == R.id.btn3) {
- set_xinlang();
- }
- }
-
- private void onclick() {
- btn1.setOnClickListener(this);
- btn2.setOnClickListener(this);
- btn3.setOnClickListener(this);
- }
-
- private void findview() {
- btn1 = findViewById(R.id.btn1);
- btn2 = findViewById(R.id.btn2);
- btn3 = findViewById(R.id.btn3);
- }
-
- @Override
- protected void onDestroy() {
- JPushDengluUtils.ondes();
- super.onDestroy();
-
- }
-
-
- /**
- * --------------------------------业务逻辑分割线----------------------------------
- */
-
- /**
- * 设置QQ授权bufen
- */
- private void set_qq() {
- JPushDengluUtils.shezhi_shouquan(QQ.Name);
- }
-
- /**
- * 设置微信授权bufen
- */
- private void set_weixin() {
- JPushDengluUtils.shezhi_shouquan(Wechat.Name);
- }
-
- /**
- * 设置新浪授权bufen
- */
- private void set_xinlang() {
-// JPushDengluUtils.shezhi_shouquan(SinaWeibo.Name);
- }
-
-
- @Override
- public void onResults(String platform, String toastMsg, String data) {
- Toast.makeText(getApplicationContext(), platform + "---" + toastMsg + "---" + data, Toast.LENGTH_LONG).show();
- }
-}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/ShareIndex2Activity.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/ShareIndex2Activity.java
deleted file mode 100644
index eba3848b..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/denglu/ShareIndex2Activity.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.example.slbappjpushshare.denglu;
-
-import android.app.Activity;
-import android.os.Bundle;
-//import android.support.annotation.Nullable;
-import android.view.View;
-import android.widget.Button;
-import android.widget.Toast;
-
-import androidx.annotation.Nullable;
-
-import com.example.slbappjpushshare.R;
-
-import cn.jiguang.share.android.api.Platform;
-import cn.jiguang.share.qqmodel.QQ;
-import cn.jiguang.share.wechat.Wechat;
-
-public class ShareIndex2Activity extends Activity implements View.OnClickListener, OnResultInfoLitener {
-
- private String TAG = this.getClass().getSimpleName();
- private Button btn1;
- private Button btn2;
- private Button btn3;
- private JPushDengluUtils JPushDengluUtils;
-
- private int type;
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_shareindex2);
- findview();
- onclick();
- donetwork();
- }
-
- private void donetwork() {
- type = getIntent().getIntExtra("type", Platform.ACTION_SHARE);
- JPushDengluUtils = new JPushDengluUtils(this);
-// platformList = JShareInterface.getPlatformList();
- if (type == Platform.ACTION_USER_INFO) {
- if (JPushDengluUtils.en_shouquan(QQ.Name)) {
- btn1.setText(QQ.Name + "已授权");
- }
- if (JPushDengluUtils.en_shouquan(Wechat.Name)) {
- btn2.setText(Wechat.Name + "已授权");
- }
-// if (JPushDengluUtils.en_shouquan(SinaWeibo.Name)) {
-// btn3.setText(SinaWeibo.Name + "已授权");
-// }
- }
-
-
- }
-
- @Override
- public void onClick(View v) {
- int i = v.getId();
- if (i == R.id.btn1) {
- set_qq();
- } else if (i == R.id.btn2) {
- set_weixin();
- } else if (i == R.id.btn3) {
- set_xinlang();
- }
- }
-
- private void onclick() {
- btn1.setOnClickListener(this);
- btn2.setOnClickListener(this);
- btn3.setOnClickListener(this);
- }
-
- private void findview() {
- btn1 = findViewById(R.id.btn1);
- btn2 = findViewById(R.id.btn2);
- btn3 = findViewById(R.id.btn3);
- }
-
- @Override
- protected void onDestroy() {
- JPushDengluUtils.ondes();
- super.onDestroy();
-
- }
-
-
- /**
- * --------------------------------业务逻辑分割线----------------------------------
- */
-
- /**
- * 设置QQ授权bufen
- */
- private void set_qq() {
- JPushDengluUtils.shezhi_shouquan_getinfo(QQ.Name);
- }
-
- /**
- * 设置微信授权bufen
- */
- private void set_weixin() {
- JPushDengluUtils.shezhi_shouquan_getinfo(Wechat.Name);
- }
-
- /**
- * 设置新浪授权bufen
- */
- private void set_xinlang() {
-// JPushDengluUtils.shezhi_shouquan_getinfo(SinaWeibo.Name);
- }
-
-
- @Override
- public void onResults(String platform, String toastMsg, String data) {
- Toast.makeText(getApplicationContext(), platform + "---" + toastMsg + "---" + data, Toast.LENGTH_LONG).show();
- }
-}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/JPushShareUtils.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/JPushShareUtils.java
deleted file mode 100644
index c33a776e..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/JPushShareUtils.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package com.example.slbappjpushshare.fenxiang;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.drawable.BitmapDrawable;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.util.Log;
-import java.io.BufferedInputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.HashMap;
-import cn.jiguang.share.android.api.PlatActionListener;
-import cn.jiguang.share.android.api.Platform;
-
-public class JPushShareUtils {
-
- private static final String TAG = JPushShareUtils.class.getName();
- public static String share_url = "http://blog.51cto.com/liangxiao";
- public static String share_text = "一个行走的geek,一个行走的CD";
- public static String share_title = " 梁肖技术中心-51CTO博客";
- public static String share_image_assets_url = "file:///android_asset/" + "img/geek_icon.png";
- public static String share_imageurl = "https://s2.51cto.com//wyfs02/M01/89/BA/wKioL1ga-u7QnnVnAAAfrCiGnBQ946_middle.jpg";
- public static String share_imageurl_1 = "http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1308/02/c0/24056523_1375430477597.jpg";
- public static String share_videourl = "http://v.youku.com/v_show/id_XOTQwMDE1ODAw.html?from=s1.8-1-1.2&spm=a2h0k.8191407.0.0";
- public static String share_musicurl = "http://music.huoxing.com/upload/20130330/1364651263157_1085.mp3";
- public static String music_shareUrl = "https://y.qq.com/n/yqq/song/109325260_num.html?ADTAG=h5_playsong&no_redirect=1";
- public static String APP_ID = "wxa3fa50c49fcd271c";// wxfd6dfaf7196fc320
- public static String APP_KEY = "e8a93eed2ccd89b047f29d0aa62e1c95";// 0431ee301b83b6c00794493c448d980c dabe083e20ccacfed39e62df72c58f41
-
- private OnShareResultInfoLitener onShareResultInfoLitener;
-
- public JPushShareUtils(OnShareResultInfoLitener onShareResultInfoLitener) {
- this.onShareResultInfoLitener = onShareResultInfoLitener;
-
- }
-
- private Handler mHandler = new Handler(new Handler.Callback() {
- @Override
- public boolean handleMessage(Message msg) {
-// String toastMsg = (String) msg.obj;
- Bundle b = msg.getData();
- String platform = b.getString("platform");
- String toastMsg = b.getString("toastMsg");
- String data = b.getString("data");
- if (onShareResultInfoLitener != null) {
- onShareResultInfoLitener.onResults(platform, toastMsg, data);
- }
-
- return false;
- }
- });
-
- private void she_handler_msg(int what, String platform, String toastMsg, String datas) {
- if (mHandler == null) {
- return;
- }
- Message msg = mHandler.obtainMessage(what);
-// msg.obj = data.toString();
- Bundle b = new Bundle();
- b.putString("platform", platform);
- b.putString("toastMsg", toastMsg);
- b.putString("data", datas);
- msg.setData(b);
- msg.sendToTarget();
- }
-
- /**
- * 下载图片
- *
- * @param url
- * @return
- * @throws Exception
- */
- public Bitmap downloadUrlToBitmap(String url) throws Exception {
- HttpURLConnection urlConnection = (HttpURLConnection) new URL(url).openConnection();
- BufferedInputStream in = new BufferedInputStream(urlConnection.getInputStream(), 8 * 1024);
- Bitmap bitmap = BitmapFactory.decodeStream(in);
- urlConnection.disconnect();
- in.close();
- return bitmap;
- }
-
-
- /**
- * 从资源中获取的Drawable --> Bitmap
- *
- * @param context
- * @param drawable
- * @return
- */
- public static Bitmap drawableToBitmap(Context context, Drawable drawable) {
- BitmapDrawable bd = (BitmapDrawable) drawable;
- Bitmap bm = bd.getBitmap();
- return bm;
- }
-
- public PlatActionListener mShareListener1 = new PlatActionListener() {
- @Override
- public void onComplete(Platform platform, int action, HashMap data) {
- String toastMsg = "分享成功";
- she_handler_msg(1, platform.getName(), toastMsg, data.toString());
-
- }
-
- @Override
- public void onError(Platform platform, int action, final int errorCode, final Throwable error) {
- Log.e("LoginActivity", "error:" + errorCode + ",msg:" + error);
- String toastMsg = "分享失败";
-// she_handler_msg(1, platform.getName(),toastMsg + (error != null ? error.getMessage() : "") + "---" + errorCode, "");
- she_handler_msg(1, platform.getName(), toastMsg, "");
-
- }
-
- @Override
- public void onCancel(Platform platform, int action) {
- String toastMsg = "分享取消";
- she_handler_msg(1, platform.getName(), toastMsg, "");
-
- }
- };
-
- /**
- * 销毁bufen
- */
- public void ondes() {
- if (mHandler != null) {
- mHandler.removeCallbacksAndMessages(null);
- mHandler = null;
- }
- }
-
-// /**
-// * 跳转到微信
-// */
-// private void getWechatApi(Context context) {
-// try {
-//// Intent intent = new Intent(Intent.ACTION_MAIN);
-//// ComponentName cmp = new ComponentName("com.tencent.mm","com.tencent.mm.ui.LauncherUI");
-//// intent.addCategory(Intent.CATEGORY_LAUNCHER);
-//// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-//// intent.setComponent(cmp);
-//// context.startActivity(intent);
-// String appId = "wxd930ea5d5a258f4f"; // 填应用AppId
-// IWXAPI api = WXAPIFactory.createWXAPI(context, appId);
-//
-// WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
-// req.userName = "gh_d43f693ca31f"; // 填小程序原始id
-//// req.path = path; //拉起小程序页面的可带参路径,不填默认拉起小程序首页
-// req.miniprogramType = WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE;// 可选打开 开发版,体验版和正式版
-// api.sendReq(req);
-// } catch (ActivityNotFoundException e) {
-// // TODO: handle exception
-//// showToastLong("检查到您手机没有安装微信,请安装后使用该功能");
-// }
-// }
-
-}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/OnShareResultInfoLitener.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/OnShareResultInfoLitener.java
deleted file mode 100644
index fdaf9311..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/OnShareResultInfoLitener.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.example.slbappjpushshare.fenxiang;
-
-/**
- * 授权登录的回调接口
- *
- * @author geek
- */
-public interface OnShareResultInfoLitener {
- void onResults(String platform, String toastMsg, String data);
-}
\ No newline at end of file
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareBottomActivity.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareBottomActivity.java
deleted file mode 100644
index 068b96fd..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareBottomActivity.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package com.example.slbappjpushshare.fenxiang;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.os.Handler;
-//import android.support.annotation.Nullable;
-import android.view.View;
-import android.view.WindowManager;
-import android.widget.LinearLayout;
-import android.widget.Toast;
-
-import androidx.annotation.Nullable;
-
-import com.example.slbappjpushshare.R;
-import com.example.slbappjpushshare.fenxiang.beans.WeixinBeanParam;
-
-import cn.jiguang.share.android.api.JShareInterface;
-import cn.jiguang.share.qqmodel.QQ;
-import cn.jiguang.share.qqmodel.QZone;
-import cn.jiguang.share.wechat.Wechat;
-import cn.jiguang.share.wechat.WechatFavorite;
-import cn.jiguang.share.wechat.WechatMoments;
-
-public class ShareBottomActivity extends Activity implements View.OnClickListener, OnShareResultInfoLitener {
-
- private String TAG = this.getClass().getSimpleName();
- private LinearLayout ll1;
- private LinearLayout ll1a;
- private LinearLayout ll2;
- private LinearLayout ll2a;
- private LinearLayout ll3;
- private LinearLayout ll3a;
- private LinearLayout ll4;
- private LinearLayout ll4a;
- private LinearLayout ll5;
- private LinearLayout ll5a;
- private LinearLayout ll6;
- private LinearLayout ll6a;
- private LinearLayout ll7;
- private LinearLayout ll7a;
- private LinearLayout llMail;
- private JPushShareUtils jPushShareUtils;
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_share_bottom);
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
- findViewId();
-
- mHandler = new Handler();
- jPushShareUtils = new JPushShareUtils(this);
- }
-
- private void findViewId() {
- ll1 = findViewById(R.id.ll1);
- ll1a = findViewById(R.id.ll1a);
- ll2 = findViewById(R.id.ll2);
- ll2a = findViewById(R.id.ll2a);
- ll3 = findViewById(R.id.ll3);
- ll3a = findViewById(R.id.ll3a);
- ll4 = findViewById(R.id.ll4);
- ll4a = findViewById(R.id.ll4a);
- ll5 = findViewById(R.id.ll5);
- ll5a = findViewById(R.id.ll5a);
- ll6 = findViewById(R.id.ll6);
- ll6a = findViewById(R.id.ll6a);
- ll7 = findViewById(R.id.ll7);
- ll7a = findViewById(R.id.ll7a);
- llMail = findViewById(R.id.ll_mail);
-
- ll1.setOnClickListener(this);
- ll2.setOnClickListener(this);
- ll3.setOnClickListener(this);
- ll4.setOnClickListener(this);
- ll5.setOnClickListener(this);
- ll6.setOnClickListener(this);
- ll7.setOnClickListener(this);
-
- }
-
- String name = "";
- private Handler mHandler;
-
- @Override
- public void onClick(View v) {
- int i = v.getId();
- if (i == R.id.ll1) {
- name = Wechat.Name;
- } else if (i == R.id.ll2) {
- name = WechatMoments.Name;
- } else if (i == R.id.ll3) {
- name = WechatFavorite.Name;
- } else if (i == R.id.ll4) {
- name = QQ.Name;
- } else if (i == R.id.ll5) {
- name = QZone.Name;
- } else if (i == R.id.ll6) {
-// name = SinaWeibo.Name;
- } else if (i == R.id.ll7) {
-// name = SinaWeiboMessage.Name;
- }
- //复制assets图片到本地路径bufen
-// ShareFileCopyAssets.fagnfa();
-// JShareInterface.share(name,
-// WeixinBeanParam.share_web(
-// JPushShareUtils.share_title,
-// JPushShareUtils.share_text,
-// JPushShareUtils.share_url,
-// ShareFileCopyAssets.ImagePath),
-// mShareListener);
- //本地drawable转bitmap
-// JShareInterface.share(name,
-// WeixinBeanParam.share_web2(
-// JPushShareUtils.share_title,
-// JPushShareUtils.share_text,
-// JPushShareUtils.share_url,
-// JPushShareUtils.drawableToBitmap2(ShareBottomActivity.this, getDrawable(R.drawable.geek_icon))),
-// mShareListener);
- //null转bitmap 默认为icon_launcher
-// JShareInterface.share(name,
-// WeixinBeanParam.share_web2(
-// JPushShareUtils.share_title,
-// JPushShareUtils.share_text,
-// JPushShareUtils.share_url,
-// null),
-// mShareListener);
- //本地drawable转bitmap
- JShareInterface.share(name,
- WeixinBeanParam.share_web2(
- JPushShareUtils.share_title,
- JPushShareUtils.share_text,
- JPushShareUtils.share_url,
- JPushShareUtils.drawableToBitmap(ShareBottomActivity.this, getDrawable(R.drawable.geek_icon))),
- jPushShareUtils.mShareListener1);
- //
-// JShareInterface.share(name,
-// WeixinBeanParam.share_wenben(),
-// jPushShareUtils.mShareListener1);
- //网络图片转bitmap
-// JShareInterface.share(name,
-// WeixinBeanParam.share_web2(
-// JPushShareUtils.share_title,
-// JPushShareUtils.share_text,
-// JPushShareUtils.share_url,
-// JPushShareUtils.returnBitMap(JPushShareUtils.share_imageurl)),
-// mShareListener);
- }
-
- @Override
- protected void onDestroy() {
- jPushShareUtils.ondes();
- super.onDestroy();
-
- }
-
-
- @Override
- public void onResults(String platform, String toastMsg, String data) {
- Toast.makeText(getApplicationContext(), toastMsg, Toast.LENGTH_LONG).show();
- finish();
- }
-}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareFileCopyAssets.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareFileCopyAssets.java
deleted file mode 100644
index 1af06b41..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareFileCopyAssets.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.example.slbappjpushshare.fenxiang;
-
-import com.blankj.utilcode.util.Utils;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class ShareFileCopyAssets {
-
- public static String ImagePath;
- public static String VideoPath;
-
- public static void fagnfa() {
- new Thread() {
- @Override
- public void run() {
- File imageFile = copyResurces("img/geek_icon.png", "geek_icon.png", 0);
-// File videoFile = copyResurces("apks/1.apk", "shiningandgeek_test.apk", 0);
- if (imageFile != null) {
- ImagePath = imageFile.getAbsolutePath();
- }
-//
-// if (videoFile != null) {
-// VideoPath = videoFile.getAbsolutePath();
-// }
-
- super.run();
- }
- }.start();
- }
-
- public static File copyResurces(String src, String dest, int flag) {
- File filesDir = null;
- try {
- if (flag == 0) {//copy to sdcard
- filesDir = new File(Utils.getApp().getExternalFilesDir(null).getAbsoluteFile() + "/slbapp/" + dest);
- File parentDir = filesDir.getParentFile();
- if (!parentDir.exists()) {
- parentDir.mkdirs();
- }
- } else {//copy to data
- filesDir = new File(Utils.getApp().getFilesDir(), dest);
- }
- if (!filesDir.exists()) {
- filesDir.createNewFile();
- InputStream open = Utils.getApp().getAssets().open(src);
- FileOutputStream fileOutputStream = new FileOutputStream(filesDir);
- byte[] buffer = new byte[4 * 1024];
- int len = 0;
- while ((len = open.read(buffer)) != -1) {
- fileOutputStream.write(buffer, 0, len);
- }
- open.close();
- fileOutputStream.close();
- }
- } catch (IOException e) {
- e.printStackTrace();
- if (flag == 0) {
- filesDir = copyResurces(src, dest, 1);
- }
- }
- return filesDir;
- }
-}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareUtils.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareUtils.java
deleted file mode 100644
index d39a79e9..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/ShareUtils.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package com.example.slbappjpushshare.fenxiang;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.drawable.BitmapDrawable;
-import android.graphics.drawable.Drawable;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.os.Looper;
-import android.os.Message;
-import android.util.Log;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-
-import cn.jiguang.share.android.api.JShareInterface;
-import cn.jiguang.share.android.api.PlatActionListener;
-import cn.jiguang.share.android.api.Platform;
-import cn.jiguang.share.android.api.ShareParams;
-
-public class ShareUtils {
-
- private static final String TAG = ShareUtils.class.getName();
- public static String share_url = "http://blog.51cto.com/liangxiao";
- public static String share_text = "一个行走的geek,一个行走的CD";
- public static String share_title = " 梁肖技术中心-51CTO博客";
- public static String share_image_assets_url = "file:///android_asset/" + "img/geek_icon.png";
- public static String share_imageurl = "https://s2.51cto.com//wyfs02/M01/89/BA/wKioL1ga-u7QnnVnAAAfrCiGnBQ946_middle.jpg";
- public static String share_imageurl_1 = "http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1308/02/c0/24056523_1375430477597.jpg";
- public static String share_videourl = "http://v.youku.com/v_show/id_XOTQwMDE1ODAw.html?from=s1.8-1-1.2&spm=a2h0k.8191407.0.0";
- public static String share_musicurl = "http://music.huoxing.com/upload/20130330/1364651263157_1085.mp3";
- public static String music_shareUrl = "https://y.qq.com/n/yqq/song/109325260_num.html?ADTAG=h5_playsong&no_redirect=1";
-
-
- /**
- * 从资源中获取的Drawable --> Bitmap
- *
- * @param context
- * @param drawable
- * @return
- */
- public static Bitmap drawableToBitmap(Context context, Drawable drawable) {
- BitmapDrawable bd = (BitmapDrawable) drawable;
- Bitmap bm = bd.getBitmap();
- return bm;
- }
-
- /**
- * 根据图片的url路径获得Bitmap对象
- *
- * @param url
- * @return
- */
-
- public static Bitmap bitmap;
-
- public static Bitmap returnBitMap(final String url) {
- new Thread(new Runnable() {
- @Override
- public void run() {
- URL imageurl = null;
-
- try {
- imageurl = new URL(url);
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- try {
- HttpURLConnection conn = (HttpURLConnection) imageurl.openConnection();
- conn.setDoInput(true);
- conn.connect();
- InputStream is = conn.getInputStream();
- bitmap = BitmapFactory.decodeStream(is);
- is.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }).start();
-
- return bitmap;
- }
-
-
- public void showShare(String name) {
- //这里以分享链接为例
- ShareParams shareParams = new ShareParams();
- shareParams.setShareType(Platform.SHARE_WEBPAGE);
- shareParams.setTitle(share_title);
- shareParams.setText(share_text);
- shareParams.setShareType(Platform.SHARE_WEBPAGE);
- shareParams.setUrl(share_url);
-// shareParams.setImagePath(ShareFileCopyAssets.ImagePath);
- shareParams.setImagePath(share_image_assets_url);
- JShareInterface.share(name, shareParams, mShareListener);
- setmHandlerThreads();
-
- }
-
- public void showShare1() {
- //这里以分享链接为例
- ShareParams shareParams = new ShareParams();
- shareParams.setShareType(Platform.SHARE_WEBPAGE);
- shareParams.setTitle(share_title);
- shareParams.setText(share_text);
- shareParams.setShareType(Platform.SHARE_WEBPAGE);
- shareParams.setUrl(share_url);
- shareParams.setImagePath(share_image_assets_url);
-
- }
-
- private PlatActionListener mShareListener = new PlatActionListener() {
- @Override
- public void onComplete(Platform platform, int action, HashMap data) {
- if (mHandler != null) {
- Message message = mHandler.obtainMessage();
- message.obj = "分享成功";
- mHandler.sendMessage(message);
- }
- }
-
- @Override
- public void onError(Platform platform, int action, int errorCode, Throwable error) {
- Log.e(TAG, "error:" + errorCode + ",msg:" + error);
- if (mHandler != null) {
- Message message = mHandler.obtainMessage();
-// message.obj = "分享失败:" + error.getMessage() + "---" + errorCode;
- message.obj = "分享失败";
- mHandler.sendMessage(message);
- }
- }
-
- @Override
- public void onCancel(Platform platform, int action) {
- if (mHandler != null) {
- Message message = mHandler.obtainMessage();
- message.obj = "分享取消";
- mHandler.sendMessage(message);
- }
- }
- };
-
-
- private HandlerThread mHandlerThread;
- private H mHandler;
-
- private class H extends Handler {
-
- public H(Looper looper) {
- super(looper);
- }
-
- @Override
- public void handleMessage(Message msg) {
- super.handleMessage(msg);
- //这个方法是运行在 handler-thread 线程中的 ,可以执行耗时操作
- Log.d("handler ", "消息: " + msg.what + " 线程: " + Thread.currentThread().getName());
- String toastMsg = (String) msg.obj;
-// Toasty.info(get, toastMsg).show();
- //释放资源
- mHandlerThread.quit();
- }
- }
-
- public void setmHandlerThreads() {
- mHandlerThread = new HandlerThread("分享第三方图文Handler");
- mHandlerThread.start();
- mHandler = new H(mHandlerThread.getLooper());
- }
-
- public void desShare() {
- //释放资源
- mHandlerThread.quit();
- }
-}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/beans/WeixinBeanParam.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/beans/WeixinBeanParam.java
deleted file mode 100644
index fa07f027..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/fenxiang/beans/WeixinBeanParam.java
+++ /dev/null
@@ -1,238 +0,0 @@
-package com.example.slbappjpushshare.fenxiang.beans;
-
-import android.graphics.Bitmap;
-import java.io.ByteArrayOutputStream;
-import cn.jiguang.share.android.api.Platform;
-import cn.jiguang.share.android.api.ShareParams;
-
-public class WeixinBeanParam {
-
- /**
- * 分享文本
- */
- public static ShareParams share_wenben() {
- ShareParams shareParams = new ShareParams();
- shareParams.setShareType(Platform.SHARE_TEXT);
- shareParams.setText("Text");//必须
- return shareParams;
- }
-
- /**
- * 分享图片1 路径
- */
- public static ShareParams share_img1(String img_url) {
- ShareParams shareParams = new ShareParams();
- shareParams.setShareType(Platform.SHARE_IMAGE);
- shareParams.setImagePath(img_url);
- return shareParams;
- }
-
- /**
- * 分享图片2 bitmap
- */
- public static ShareParams share_img2(Bitmap bitmap) {
- ShareParams shareParams = new ShareParams();
- shareParams.setShareType(Platform.SHARE_IMAGE);
- shareParams.setImageData(bitmap);
- return shareParams;
- }
-
- /**
- * 分享音乐
- */
- public static ShareParams share_music(String share_title, String share_text, String url, String music_url, String fileurl) {
- ShareParams shareParams = new ShareParams();
- shareParams.setTitle(share_title);
- shareParams.setText(share_text);
- shareParams.setShareType(Platform.SHARE_MUSIC);
- shareParams.setUrl(url);
- shareParams.setMusicUrl(music_url);
- shareParams.setImagePath(fileurl);
- return shareParams;
- }
-
- /**
- * 分享视频
- */
- public static ShareParams share_video(String share_title, String share_text, String url, String share_videourl, String fileurl) {
- ShareParams shareParams = new ShareParams();
- shareParams.setTitle(share_title);
- shareParams.setText(share_text);
- shareParams.setShareType(Platform.SHARE_VIDEO);
- shareParams.setUrl(share_videourl);
- shareParams.setImagePath(fileurl);
- return shareParams;
- }
-
- /**
- * 分享网页
- */
- public static ShareParams share_web(String share_title, String share_text, String url, String fileurl) {
- ShareParams shareParams = new ShareParams();
- shareParams.setTitle(share_title);
- shareParams.setText(share_text);
- shareParams.setShareType(Platform.SHARE_WEBPAGE);
- shareParams.setUrl(url);//必须
- shareParams.setImagePath(fileurl);
- return shareParams;
- }
-
- /**
- * 分享网页
- */
- public static ShareParams share_web2(String share_title, String share_text, String url, Bitmap fileurl) {
- ShareParams shareParams = new ShareParams();
- shareParams.setTitle(share_title);
- shareParams.setText(share_text);
- shareParams.setShareType(Platform.SHARE_WEBPAGE);
- shareParams.setUrl(url);//必须
- shareParams.setImageData(fileurl);
- return shareParams;
- }
-
- // APP_ID 替换为你的应用从官方网站申请到的合法appID
-// private static final String APP_ID = "wx211138e4dcf53523";
-
-// public static void set_xcx(Context context, final String title, final String name, String imgUrl, String url1, final String url2) {
-//// //初始化一个WXWebpageObject,填写url
-//// WXWebpageObject webpage = new WXWebpageObject();
-//// webpage.webpageUrl = url1;
-////
-//// //用 WXWebpageObject 对象初始化一个 WXMediaMessage 对象
-//// WXMediaMessage msg = new WXMediaMessage(webpage);
-//// msg.title = title;
-//// msg.description = name;
-//// Bitmap thumbBmp = BitmapFactory.decodeResource(context.getResources(), R.drawable.slb_logo_comm);
-//// msg.thumbData = bmpToByteArray(thumbBmp, true);
-////
-//// //构造一个Req
-//// SendMessageToWX.Req req = new SendMessageToWX.Req();
-////// req.transaction = buildTransaction("webpage");
-//// req.transaction = "";
-//// req.message = msg;
-//// req.scene = SendMessageToWX.Req.WXSceneSession ;
-////// req.userOpenId = getOpenId();
-////
-// //调用api接口,发送数据到微信
-// // 通过WXAPIFactory工厂,获取IWXAPI的实例
-// final IWXAPI api = WXAPIFactory.createWXAPI(context, JPushShareUtils.APP_ID, true);
-// // 将应用的appId注册到微信
-// api.registerApp(JPushShareUtils.APP_ID);
-//// api.sendReq(req);
-//
-// //
-// WXMiniProgramObject miniProgram = new WXMiniProgramObject();
-//// miniProgram.webpageUrl=url1;//自定义
-// miniProgram.webpageUrl = "http://www.qq.com";//自定义
-// miniProgram.userName = "gh_1d24d5825541";//小程序端提供参数
-//// miniProgram.path = "/pages/readPicbook?bookItemId=" + imgUrl;//小程序端提供参数
-// miniProgram.path = url1;//小程序端提供参数
-// final WXMediaMessage mediaMessage = new WXMediaMessage(miniProgram);
-// mediaMessage.title = title;//自定义
-// mediaMessage.description = name;//自定义
-// //
-//// Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.slb_logo_comm);
-//// Bitmap sendBitmap = Bitmap.createScaledBitmap(bitmap, 200, 200, true);
-//// bitmap.recycle();
-// //
-// Glide.with(context).asBitmap().load(imgUrl).into(new SimpleTarget() {
-// @Override
-// public void onResourceReady(Bitmap resource, Transition super Bitmap> transition) {
-// mediaMessage.thumbData = bmpToByteArray(resource, false);
-// SendMessageToWX.Req req2 = new SendMessageToWX.Req();
-// req2.transaction = "";
-// req2.scene = SendMessageToWX.Req.WXSceneSession;
-// req2.message = mediaMessage;
-// api.sendReq(req2);
-// }
-// });
-// //
-//// RequestOptions options = new RequestOptions()
-////// .signature(new ObjectKey(UUID.randomUUID().toString())) // 重点在这行
-//// .skipMemoryCache(false)
-//// .dontAnimate()
-//// .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
-//// .placeholder(R.drawable.slb_logo_comm)
-//// .error(R.drawable.slb_logo_comm)
-//// .fallback(R.drawable.slb_logo_comm); //url为空的时候,显示的图片;
-//// Glide.with(context).asBitmap().load(imgUrl)
-//// .apply(options)
-//// .into(new Target() {
-//// @Override
-//// public void onLoadStarted(@Nullable Drawable placeholder) {
-////
-//// }
-////
-//// @Override
-//// public void onLoadFailed(@Nullable Drawable errorDrawable) {
-////
-//// }
-////
-//// @Override
-//// public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition super Bitmap> transition) {
-//// mediaMessage.thumbData = bmpToByteArray(resource, true);
-//// }
-////
-//// @Override
-//// public void onLoadCleared(@Nullable Drawable placeholder) {
-////
-//// }
-////
-//// @Override
-//// public void getSize(@NonNull SizeReadyCallback cb) {
-////
-//// }
-////
-//// @Override
-//// public void removeCallback(@NonNull SizeReadyCallback cb) {
-////
-//// }
-////
-//// @Override
-//// public void setRequest(@Nullable Request request) {
-////
-//// }
-////
-//// @Nullable
-//// @Override
-//// public Request getRequest() {
-//// return null;
-//// }
-////
-//// @Override
-//// public void onStart() {
-////
-//// }
-////
-//// @Override
-//// public void onStop() {
-////
-//// }
-////
-//// @Override
-//// public void onDestroy() {
-////
-//// }
-//// });
-//
-// }
-
- public static byte[] bmpToByteArray(final Bitmap bmp, final boolean needRecycle) {
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- bmp.compress(Bitmap.CompressFormat.PNG, 100, output);
- if (needRecycle) {
- bmp.recycle();
- }
-
- byte[] result = output.toByteArray();
- try {
- output.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return result;
- }
-
-
-}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/plugin/JChatProCallbackActivity.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/plugin/JChatProCallbackActivity.java
deleted file mode 100644
index e12b4e0b..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/plugin/JChatProCallbackActivity.java
+++ /dev/null
@@ -1,26 +0,0 @@
-//package com.example.slbappshare.plugin;
-//
-//import android.content.Intent;
-//import android.os.Bundle;
-////import android.support.annotation.Nullable;
-//
-//import androidx.annotation.Nullable;
-//
-//import cn.jiguang.share.jchatpro.JChatProHandleActivity;
-//
-///**
-// * Created by Ivanwu on 2017/12/7.
-// */
-//
-//public class JChatProCallbackActivity extends JChatProHandleActivity {
-// private static final String TAG = "JChatProCallbackActivity";
-// @Override
-// protected void onCreate(@Nullable Bundle savedInstanceState) {
-// super.onCreate(savedInstanceState);
-// }
-//
-// @Override
-// protected void onNewIntent(Intent intent) {
-// super.onNewIntent(intent);
-// }
-//}
diff --git a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/wxapi/WXEntryActivity.java b/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/wxapi/WXEntryActivity.java
deleted file mode 100644
index 07dd27fc..00000000
--- a/commonlibs/hunheku/libappjpushshare/src/main/java/com/example/slbappjpushshare/wxapi/WXEntryActivity.java
+++ /dev/null
@@ -1,56 +0,0 @@
-///*
-// * 官网地站:http://www.mob.com
-// * 技术支持QQ: 4006852216
-// * 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
-// *
-// * Copyright (c) 2013年 mob.com. All rights reserved.
-// */
-//
-//package com.example.slbappshare.wxapi;
-//
-//
-//import android.content.Intent;
-//import android.os.Bundle;
-//import android.util.Log;
-//import android.widget.Toast;
-//
-//import com.tencent.mm.opensdk.constants.ConstantsAPI;
-//import com.tencent.mm.opensdk.modelbase.BaseReq;
-//import com.tencent.mm.opensdk.modelbase.BaseResp;
-//import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
-//import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
-//
-//import cn.jiguang.share.wechat.WeChatHandleActivity;
-//
-///**
-// * 微信客户端回调activity示例
-// */
-//public class WXEntryActivity extends WeChatHandleActivity implements IWXAPIEventHandler {
-// @Override
-// protected void onCreate(Bundle savedInstanceState) {
-// super.onCreate(savedInstanceState);
-// }
-//
-// @Override
-// protected void onNewIntent(Intent intent) {
-// super.onNewIntent(intent);
-// }
-//
-// @Override
-// public void onReq(BaseReq resp) {
-// String aaa = "";
-// Log.e("--WXEntryActivity--","slbappshareWXEntryActivityononReq");
-// }
-//
-// @Override
-// public void onResp(BaseResp baseResp) {
-// Log.e("--WXEntryActivity--","slbappshareWXEntryActivityonResp");
-// if (baseResp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) {
-// WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) baseResp;
-// String extraData = launchMiniProResp.extMsg; //对应小程序组件
+
+
diff --git a/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef1.xml b/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef1.xml
index ade41064..163d4f9e 100644
--- a/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef1.xml
+++ b/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef1.xml
@@ -1,362 +1,445 @@
-
+ android:orientation="vertical">
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:background="#fff"
+ android:orientation="vertical">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef2.xml b/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef2.xml
index 6247a4d6..dc732915 100644
--- a/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef2.xml
+++ b/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef2.xml
@@ -1,274 +1,445 @@
-
+ android:layout_height="match_parent"
+ android:orientation="vertical">
-
+ android:layout_height="55dp"
+ android:layout_centerHorizontal="true"
+ android:gravity="center_vertical"
+ android:paddingLeft="20dp"
+ android:text="分类"
+ android:textColor="#ffffff"
+ android:textSize="20sp" />
-
+
-
+ android:orientation="horizontal">
+ android:textSize="12mm"
+ android:visibility="gone" />
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
-
+
+
+
+
+
+
+
+
+
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef3.xml b/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef3.xml
index 0337e2eb..b5ef17e2 100644
--- a/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef3.xml
+++ b/yewulibs1/yewulibs1-appindex/src/main/res/layout/fragment_shouyef3.xml
@@ -1,213 +1,230 @@
-
+ android:layout_height="match_parent"
+ android:orientation="vertical">
-
+
+
-
+ android:background="#fff">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
diff --git a/yewulibs1/yewulibs1-applogin/src/main/AndroidManifest.xml b/yewulibs1/yewulibs1-applogin/src/main/AndroidManifest.xml
index 36ebdf6a..3e6eb8b6 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/AndroidManifest.xml
+++ b/yewulibs1/yewulibs1-applogin/src/main/AndroidManifest.xml
@@ -9,15 +9,15 @@
android:label="@string/app_namelogin"
android:supportsRtl="true">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
data) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- Toast.makeText(getApplicationContext(), "分享成功", Toast.LENGTH_LONG);
-
- }
- });
-
- }
-
- @Override
- public void onError(Platform platform, int action, final int errorCode, final Throwable error) {
- Log.e("LoginActivity", "error:" + errorCode + ",msg:" + error);
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- Toast.makeText(getApplicationContext(), "分享失败:" + error.getMessage() + "---" + errorCode, Toast.LENGTH_LONG);//41020
- }
- });
- }
-
- @Override
- public void onCancel(Platform platform, int action) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- Toast.makeText(getApplicationContext(), "分享取消", Toast.LENGTH_LONG);
- }
- });
-
- }
- };
-
- @Override
- protected void onDestroy() {
- if (mHandler != null) {
- mHandler.removeCallbacksAndMessages(null);
- mHandler = null;
- }
- if (img_handler != null) {
- img_handler.removeCallbacksAndMessages(null);
- img_handler = null;
- }
- super.onDestroy();
-
- }
-
-}
+// denglu();
+// } else if (i == R.id.btn_cancel) {
+//// if (!is_login()) {
+//// return;
+//// }
+// linshifangwen();
+// } else if (i == R.id.tv_zc) {
+// zhuce();
+// } else if (i == R.id.tv_wjmm) {
+// wangjimima();
+// } else if (i == R.id.iv_wx) {
+// qita_wx_login();
+// } else if (i == R.id.iv_wx2) {
+// qita_wx_share();
+// }
+// }
+//
+// private void onLoginSuccess() {
+// setResult(SlbLoginUtil.LOGIN_RESULT_OK);
+// finish();
+// }
+//
+// private void onLoginCanceled() {
+// setResult(SlbLoginUtil.LOGIN_RESULT_CANCELED);
+// finish();
+// }
+//
+// /**
+// * 登录操作
+// */
+// private void donetlogin() {
+// //step 请求服务器成功后清除sp中的数据
+//// SpUtils.get(this).get("", "");
+// onLoginSuccess();
+// }
+//
+// private boolean is_login() {
+// String a = edt1.getText().toString().trim();
+// String b = edt2.getText().toString().trim();
+// if (TextUtils.isEmpty(a)) {
+// ToastUtils.showLong("请输入您的账号");
+// return false;
+// }
+// if (TextUtils.isEmpty(b)) {
+// ToastUtils.showLong("请输入您的密码");
+// return false;
+// }
+// return true;
+// }
+//
+//
+// /**
+// *
+// *
+// * ----------------------------------下面为业务逻辑--分割线------------------------------
+// *
+// */
+//
+// /**
+// * 记住密码 选中业务
+// */
+// private void jzmm_xuanzhong() {
+// ToastUtils.showLong("scb_cen_degree: checked");
+//
+// }
+//
+// /**
+// * 记住密码 取消业务
+// */
+// private void jzmm_quxiao() {
+// ToastUtils.showLong("scb_cen_degree: unchecked");
+//
+// }
+//
+// /**
+// * 自动登录 选中业务
+// */
+// private void zddl_xuanzhong() {
+// ToastUtils.showLong("scb_fah_degree: checked");
+//
+// }
+//
+// /**
+// * 自动登录 取消业务
+// */
+// private void zddl_quxiao() {
+// ToastUtils.showLong("scb_fah_degree: unchecked");
+//
+// }
+//
+// /**
+// * 登录
+// */
+// private void denglu() {
+// ToastUtils.showLong("登录");
+// donetlogin();
+//// startActivity(new Intent("hs.act.slbapp.index"));
+//
+// }
+//
+// /**
+// * 临时访问
+// */
+// private void linshifangwen() {
+// ToastUtils.showLong("临时访问");
+//
+// }
+//
+// /**
+// * 注册
+// */
+// private void zhuce() {
+// startActivity(new Intent(AppUtils.getAppPackageName() + ".hs.act.slbapp.ZhuceActivity"));
+// }
+//
+// /**
+// * 忘记密码
+// */
+// private void wangjimima() {
+// startActivity(new Intent(AppUtils.getAppPackageName() + ".hs.act.slbapp.WangjiActivity"));
+//
+// }
+//
+// /**
+// * 其他方式登录 - 微信
+// */
+// private void qita_wx_login() {
+// ToastUtils.showLong("微信");
+// JPushDengluUtils JPushDengluUtils = new JPushDengluUtils(this);
+// JPushDengluUtils.shezhi_shouquan_getinfo("Wechat");
+// }
+//
+//
+// @Override
+// public void onResults(String platform, String toastMsg, String data) {
+// ToastUtils.showLong(platform + "---" + toastMsg + "---" + data);
+// }
+//
+// /**
+// * 其他方式分享 - 微信
+// */
+// private void qita_wx_share() {
+// //网络图片转bitmap
+// new Thread(new Runnable() {
+// @Override
+// public void run() {
+// try {
+// Bitmap bitmap = downloadUrlToBitmap(JPushShareUtils.share_imageurl);
+// Message msg = Message.obtain();
+// msg.obj = bitmap;
+// img_handler.sendMessage(msg);
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// }
+// }).start();
+//
+// }
+//
+// private Handler img_handler = new Handler(new Handler.Callback() {
+// @Override
+// public boolean handleMessage(Message message) {
+// Bitmap bitmap = (Bitmap) message.obj;
+// JShareInterface.share("Wechat",
+// WeixinBeanParam.share_web2(
+// JPushShareUtils.share_title,
+// JPushShareUtils.share_text,
+// JPushShareUtils.share_url,
+// bitmap),
+// mShareListener1);
+// return true;
+// }
+// });
+//
+// /**
+// * 下载图片
+// *
+// * @param url
+// * @return
+// * @throws Exception
+// */
+// private Bitmap downloadUrlToBitmap(String url) throws Exception {
+// HttpURLConnection urlConnection = (HttpURLConnection) new URL(url).openConnection();
+// BufferedInputStream in = new BufferedInputStream(urlConnection.getInputStream(), 8 * 1024);
+// Bitmap bitmap = BitmapFactory.decodeStream(in);
+// urlConnection.disconnect();
+// in.close();
+// return bitmap;
+// }
+//
+// private Handler mHandler = new Handler();
+// private PlatActionListener mShareListener1 = new PlatActionListener() {
+// @Override
+// public void onComplete(Platform platform, int action, HashMap data) {
+// mHandler.post(new Runnable() {
+// @Override
+// public void run() {
+// Toast.makeText(getApplicationContext(), "分享成功", Toast.LENGTH_LONG);
+//
+// }
+// });
+//
+// }
+//
+// @Override
+// public void onError(Platform platform, int action, final int errorCode, final Throwable error) {
+// Log.e("LoginActivity", "error:" + errorCode + ",msg:" + error);
+// mHandler.post(new Runnable() {
+// @Override
+// public void run() {
+// Toast.makeText(getApplicationContext(), "分享失败:" + error.getMessage() + "---" + errorCode, Toast.LENGTH_LONG);//41020
+// }
+// });
+// }
+//
+// @Override
+// public void onCancel(Platform platform, int action) {
+// mHandler.post(new Runnable() {
+// @Override
+// public void run() {
+// Toast.makeText(getApplicationContext(), "分享取消", Toast.LENGTH_LONG);
+// }
+// });
+//
+// }
+// };
+//
+// @Override
+// protected void onDestroy() {
+// if (mHandler != null) {
+// mHandler.removeCallbacksAndMessages(null);
+// mHandler = null;
+// }
+// if (img_handler != null) {
+// img_handler.removeCallbacksAndMessages(null);
+// img_handler = null;
+// }
+// super.onDestroy();
+//
+// }
+//
+//}
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginMainActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginMainActivity.java
index 01fe8ca5..b3a97596 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginMainActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginMainActivity.java
@@ -5,7 +5,7 @@
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.geek.libutils.SlbLoginUtil;
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginOutActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginOutActivity.java
index 40caf628..e65bb8f4 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginOutActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/LoginOutActivity.java
@@ -8,7 +8,7 @@
import androidx.annotation.Nullable;
import com.blankj.utilcode.util.SPUtils;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.geek.libutils.SlbLoginUtil;
public class LoginOutActivity extends SlbBaseActivity {
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/WangjiActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/WangjiActivity.java
index 22e1fd6d..e68138e7 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/WangjiActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/WangjiActivity.java
@@ -12,7 +12,7 @@
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.ToastUtils;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.example.slbapplogin.msg.YanzhengUtil;
public class WangjiActivity extends SlbBaseActivity implements View.OnClickListener {
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/ZhuceActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/ZhuceActivity.java
index 01825aa7..832b4950 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/ZhuceActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/ZhuceActivity.java
@@ -12,7 +12,7 @@
import androidx.annotation.Nullable;
import com.blankj.utilcode.util.ToastUtils;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.example.slbapplogin.msg.YanzhengUtil;
import com.haier.cellarette.libwebview.hois2.HiosHelper;
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginActivity.java
index 1a5ab9e5..60d3fd1d 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginActivity.java
@@ -21,7 +21,6 @@
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatEditText;
-import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.RegexUtils;
@@ -36,19 +35,16 @@
import com.example.bizyewu2.view.HErweimaView;
import com.example.bizyewu2.view.HUserInfoView;
import com.example.bizyewu2.view.HYonghudengluView;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.example.slbappcomm.utils.CommonUtils;
import com.example.slbapplogin.R;
import com.example.slbapplogin.msg.AppPermissionUtil;
import com.example.slbapplogin.msg.SMSBroadcastReceiver;
import com.example.slbapplogin.msg.YanzhengUtil;
-import com.example.slbappjpushshare.denglu.JPushDengluUtils;
-import com.example.slbappjpushshare.denglu.OnResultInfoLitener;
import com.geek.libutils.SlbLoginUtil;
import com.geek.libutils.app.MyLogUtil;
import com.geek.libutils.data.MmkvUtils;
import com.google.android.material.textfield.TextInputLayout;
-import com.haier.cellarette.baselibrary.btnonclick.view.BounceView;
import com.haier.cellarette.baselibrary.loading.ShowLoadingUtil;
import com.haier.cellarette.baselibrary.qcode.ExpandViewRect;
import com.haier.cellarette.baselibrary.widget.AlertView;
@@ -79,7 +75,6 @@ public class SlbLoginActivity extends SlbBaseActivity implements View.OnClickLis
private HErweimaPresenter presentercode;
private HUserInfoPresenter userInfoPresenter;
//
- private JPushDengluUtils jPushDengluUtils;
private String openid;
private String unionid;
private String gender;
@@ -211,23 +206,23 @@ public void onMultiClick(View v) {
}
});
tv1.setOnClickListener(this);
- jPushDengluUtils = new JPushDengluUtils(new OnResultInfoLitener() {
- @Override
- public void onResults(String platform, String toastMsg, String data) {
-// Toasty.normal(BaseApp.get(), platform + "---" + toastMsg + "---" + data).show();
- // 微信登录成功bufen
- JSONObject jsonObject = JSONObject.parseObject(data);
- if (jsonObject == null) {
- return;
- }
- openid = (String) jsonObject.get("openid");
- nickName = (String) jsonObject.get("nickname");
- gender = (int) jsonObject.get("sex") + "";
- avatar = (String) jsonObject.get("headimgurl");
- unionid = (String) jsonObject.get("unionid");
-// presenter.getWeChatLoginData(openid, unionid, gender, nickName, avatar);
- }
- });
+// jPushDengluUtils = new JPushDengluUtils(new OnResultInfoLitener() {
+// @Override
+// public void onResults(String platform, String toastMsg, String data) {
+//// Toasty.normal(BaseApp.get(), platform + "---" + toastMsg + "---" + data).show();
+// // 微信登录成功bufen
+// JSONObject jsonObject = JSONObject.parseObject(data);
+// if (jsonObject == null) {
+// return;
+// }
+// openid = (String) jsonObject.get("openid");
+// nickName = (String) jsonObject.get("nickname");
+// gender = (int) jsonObject.get("sex") + "";
+// avatar = (String) jsonObject.get("headimgurl");
+// unionid = (String) jsonObject.get("unionid");
+//// presenter.getWeChatLoginData(openid, unionid, gender, nickName, avatar);
+// }
+// });
edt1.addTextChangedListener(textWatcher);
edt2.addTextChangedListener(textWatcher);
}
@@ -455,7 +450,6 @@ protected void onDestroy() {
presentercode.onDestory();
userInfoPresenter.onDestory();
YanzhengUtil.timer_des();
- jPushDengluUtils.ondes();
SPUtils.getInstance().put(CommonUtils.APP_VERSION_CODE, AppUtils.getAppVersionCode());
if (mHandler != null) {
mHandlerThread.quit();
@@ -507,7 +501,6 @@ private void no_denglu() {
private void wxdl() {
// jPushDengluUtils.shouquan(other_login_name);
ShowLoadingUtil.showLoading(SlbLoginActivity.this, "", null);
- jPushDengluUtils.shezhi_shouquan_getinfo(other_login_name);
}
// 获取验证码bufen
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginInfoActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginInfoActivity.java
index 7b37ff97..8858d397 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginInfoActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginInfoActivity.java
@@ -20,7 +20,7 @@
import com.aigestudio.wheelpicker.widgets.WheelDatePicker;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.example.slbapplogin.R;
import com.geek.libutils.SlbLoginUtil;
import com.geek.libutils.app.BaseAppManager;
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginOutActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginOutActivity.java
index 3b4fb177..5fc0dc64 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginOutActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginOutActivity.java
@@ -9,7 +9,7 @@
import com.blankj.utilcode.util.ToastUtils;
import com.example.bizyewu2.presenter.HTuichudengluPresenter;
import com.example.bizyewu2.view.HTuichudengluView;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.example.slbappcomm.utils.CommonUtils;
import com.example.slbapplogin.R;
import com.geek.libutils.SlbLoginUtil;
diff --git a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginTelActivity.java b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginTelActivity.java
index 4b0757f4..0b82c188 100644
--- a/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginTelActivity.java
+++ b/yewulibs1/yewulibs1-applogin/src/main/java/com/example/slbapplogin/winter/SlbLoginTelActivity.java
@@ -14,7 +14,7 @@
//import com.blankj.utilcode.util.AppUtils;
//import com.blankj.utilcode.util.RegexUtils;
//import com.blankj.utilcode.util.SPUtils;
-//import com.example.slbappcomm.base.SlbBaseActivity;
+//import com.example.libbase.base.SlbBaseActivity;
//import com.example.slbapplogin.R;
//import com.example.slbapplogin.msg.YanzhengUtil;
//import com.haier.cellarette.baselibrary.toasts2.Toasty;
diff --git a/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivity.java b/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivity.java
index 7fed2385..98d9405a 100644
--- a/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivity.java
+++ b/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivity.java
@@ -14,24 +14,22 @@
import android.widget.TextView;
import androidx.annotation.Nullable;
-import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.blankj.utilcode.util.BarUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.bizyewu2.bean.SNew1SearchBean;
import com.example.bizyewu2.bean.SNew1SearchBean1;
import com.example.bizyewu2.bean.SNew1SearchBean2;
import com.example.bizyewu2.presenter.SNew1SearchPresenter;
import com.example.bizyewu2.view.SNew1SearchView;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
+import com.example.libbase.emptyview.NiubiEmptyViewNew;
import com.example.slbappcomm.widgets.recyclerviewnice.XRecyclerView;
import com.example.slbappsearch.part1.SearchBean;
import com.example.slbappsearch.part1.searchhuancun.SearchCommManager;
import com.example.slbappsearch.part2.SearchKeyListAdapter;
import com.example.slbappsearch.part3.SearchListAdapter;
-import com.haier.cellarette.baselibrary.emptyview.NiubiEmptyView;
import com.haier.cellarette.baselibrary.flowlayout.FlowLayout;
import com.haier.cellarette.baselibrary.flowlayout.TagAdapter;
import com.haier.cellarette.baselibrary.flowlayout.TagFlowLayout;
@@ -40,7 +38,6 @@
import com.haier.cellarette.libwebview.hois2.HiosHelper;
import com.umeng.analytics.MobclickAgent;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -68,7 +65,7 @@ public class SearchListActivity extends SlbBaseActivity implements View.OnClickL
private LinearLayout ll3;
private XRecyclerView recyclerView3;
private SearchListAdapter mAdapter3;
- private NiubiEmptyView niubiEmptyView3;
+ private NiubiEmptyViewNew niubiEmptyView3;
//
private String search_key;
@@ -289,7 +286,7 @@ public void onItemChildClick(BaseQuickAdapter adapter, View view, int position)
}
});
- niubiEmptyView3.setRetry(new NiubiEmptyView.RetryListener() {
+ niubiEmptyView3.setRetry(new NiubiEmptyViewNew.RetryListener() {
@Override
public void retry() {
if (!TextUtils.isEmpty(edit_query1.getText().toString().trim())) {
@@ -340,7 +337,7 @@ private void findview() {
recyclerView3.setLayoutManager(new GridLayoutManager(this, 1, RecyclerView.VERTICAL, false));
mAdapter3 = new SearchListAdapter(R.layout.activity_search_list_item3);
recyclerView3.setAdapter(mAdapter3);
- niubiEmptyView3 = new NiubiEmptyView();
+ niubiEmptyView3 = new NiubiEmptyViewNew();
niubiEmptyView3.bind(this, recyclerView3, mAdapter3);
}
diff --git a/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivityNewBeifen.java b/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivityNewBeifen.java
index e324e9d6..233795f2 100644
--- a/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivityNewBeifen.java
+++ b/yewulibs1/yewulibs1-appsearch/src/main/java/com/example/slbappsearch/SearchListActivityNewBeifen.java
@@ -3,7 +3,7 @@
//import android.content.Intent;
//import android.os.Build;
//import android.os.Bundle;
-//import android.support.annotation.Nullable;
+//
//import android.support.annotation.RequiresApi;
//import android.support.v7.widget.GridLayoutManager;
//import android.support.v7.widget.OrientationHelper;
@@ -27,7 +27,7 @@
//import com.example.biz3slbappusercenter.presenter.SSearchPresenter;
//import com.example.biz3slbappusercenter.view.SSearchView;
//import com.haier.cellarette.libutils.CommonUtils;
-//import com.example.slbappcomm.base.SlbBaseActivity;
+//import com.example.libbase.base.SlbBaseActivity;
//import com.example.slbappindex.R;
//import com.example.slbappindex.search.part1.SearchBean;
//import com.example.slbappindex.search.part1.searchhuancun.SearchCommManager;
diff --git a/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/AdActivity.java b/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/AdActivity.java
index 9fc0f261..2f400e35 100644
--- a/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/AdActivity.java
+++ b/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/AdActivity.java
@@ -16,7 +16,7 @@
import androidx.annotation.Nullable;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.example.slbappsplash.welcome.SplshActivity;
import java.util.concurrent.Executors;
diff --git a/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/SplshActivity.java b/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/SplshActivity.java
index 9ebf0798..e1ebd674 100644
--- a/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/SplshActivity.java
+++ b/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/SplshActivity.java
@@ -6,12 +6,9 @@
import android.view.View;
import androidx.annotation.Nullable;
-import androidx.core.content.ContextCompat;
import com.blankj.utilcode.util.AppUtils;
-import com.blankj.utilcode.util.BarUtils;
-import com.blankj.utilcode.util.ScreenUtils;
-import com.example.slbappcomm.base.SlbBaseActivityPermissions;
+import com.example.libbase.base.SlbBaseActivityPermissions;
import com.example.slbappsplash.R;
import com.haier.cellarette.baselibrary.splash.AlphaView;
diff --git a/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/WelComeActivity.java b/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/WelComeActivity.java
index 22928e7a..d8163a17 100644
--- a/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/WelComeActivity.java
+++ b/yewulibs1/yewulibs1-appsplash/src/main/java/com/example/slbappsplash/welcome/WelComeActivity.java
@@ -11,7 +11,7 @@
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;
-import com.example.slbappcomm.base.SlbBaseActivity;
+import com.example.libbase.base.SlbBaseActivity;
import com.example.slbappcomm.nativendk.JNIUtils2;
import com.example.slbappcomm.nativendk.KeyReflectUtils;
import com.example.slbappcomm.utils.CommonUtils;
diff --git a/yewulibs1/yewulibs1-bizyewu1/build.gradle b/yewulibs1/yewulibs1-bizyewu1/build.gradle
index 41b98046..73bc63d9 100644
--- a/yewulibs1/yewulibs1-bizyewu1/build.gradle
+++ b/yewulibs1/yewulibs1-bizyewu1/build.gradle
@@ -6,9 +6,9 @@ apply from: './../../commonlibs2.gradle'
def librarys = rootProject.ext.dependencies
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
- implementation project(':commonlibs:hunheku:libmvp')
- implementation project(':commonlibs:hunheku:libretrofit')
+ implementation project(':commonlibs:common:libutils')
+ implementation project(':commonlibs:common:libmvp')
+ implementation project(':commonlibs:common:libretrofit')
// bxnt_nationImplementation(name: 'libvariants_bxnt_nation', ext: 'aar')
// bxny_nationImplementation(name: 'libvariants_bxny_nation', ext: 'aar')
// bxn_nationImplementation(name: 'libvariants_bxn_nation', ext: 'aar')
diff --git a/yewulibs1/yewulibs1-bizyewu2/build.gradle b/yewulibs1/yewulibs1-bizyewu2/build.gradle
index 41b98046..73bc63d9 100644
--- a/yewulibs1/yewulibs1-bizyewu2/build.gradle
+++ b/yewulibs1/yewulibs1-bizyewu2/build.gradle
@@ -6,9 +6,9 @@ apply from: './../../commonlibs2.gradle'
def librarys = rootProject.ext.dependencies
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
- implementation project(':commonlibs:hunheku:libmvp')
- implementation project(':commonlibs:hunheku:libretrofit')
+ implementation project(':commonlibs:common:libutils')
+ implementation project(':commonlibs:common:libmvp')
+ implementation project(':commonlibs:common:libretrofit')
// bxnt_nationImplementation(name: 'libvariants_bxnt_nation', ext: 'aar')
// bxny_nationImplementation(name: 'libvariants_bxny_nation', ext: 'aar')
// bxn_nationImplementation(name: 'libvariants_bxn_nation', ext: 'aar')
diff --git a/yewulibs1/yewulibs1-libvariants/build.gradle b/yewulibs1/yewulibs1-libvariants/build.gradle
index e4652017..e579899a 100644
--- a/yewulibs1/yewulibs1-libvariants/build.gradle
+++ b/yewulibs1/yewulibs1-libvariants/build.gradle
@@ -39,5 +39,5 @@ android {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':commonlibs:hunheku:libutils')
+ implementation project(':commonlibs:common:libutils')
}
diff --git a/commonlibs/yewulibs/slbswipebacklayout/.gitignore b/zfsjx-commonlibs/MediaCompressLib/.gitignore
similarity index 100%
rename from commonlibs/yewulibs/slbswipebacklayout/.gitignore
rename to zfsjx-commonlibs/MediaCompressLib/.gitignore
diff --git a/zfsjx-commonlibs/MediaCompressLib/README.md b/zfsjx-commonlibs/MediaCompressLib/README.md
new file mode 100644
index 00000000..eceff62b
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/README.md
@@ -0,0 +1,2 @@
+# MediaCompressLibrary
+这是一个用于压缩MP4格式的视频的库文件,具体使用方式见博客:http://blog.csdn.net/shan286/article/details/79072286
diff --git a/zfsjx-commonlibs/MediaCompressLib/build.gradle b/zfsjx-commonlibs/MediaCompressLib/build.gradle
new file mode 100644
index 00000000..1b248d7c
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/build.gradle
@@ -0,0 +1,23 @@
+apply plugin: 'com.android.library'
+apply from: './../../commonlibs1.gradle'
+def librarys = rootProject.ext.dependencies //
+//android {
+// sourceSets.main {
+// jni.srcDirs = []
+// //LOCAL_LDFLAGS += -fuse-ld=bfd
+// //jni.srcDirs 'src/main/jni'
+// jniLibs.srcDir '../../otherjar'
+// }
+//}
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ //common url
+ implementation librarys.design
+ implementation librarys.appcompatV7
+ implementation librarys.supportannotations
+ implementation librarys.recyclerviewv7
+ implementation librarys.cardviewv7
+ implementation librarys.percent
+ implementation librarys.constraintlayout
+ implementation librarys.swiperefreshlayout
+}
\ No newline at end of file
diff --git a/zfsjx-commonlibs/MediaCompressLib/gradle/wrapper/gradle-wrapper.jar b/zfsjx-commonlibs/MediaCompressLib/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..13372aef
Binary files /dev/null and b/zfsjx-commonlibs/MediaCompressLib/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/zfsjx-commonlibs/MediaCompressLib/gradle/wrapper/gradle-wrapper.properties b/zfsjx-commonlibs/MediaCompressLib/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..a6ca311d
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 24 07:10:02 CST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/zfsjx-commonlibs/MediaCompressLib/gradlew b/zfsjx-commonlibs/MediaCompressLib/gradlew
new file mode 100644
index 00000000..9d82f789
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/zfsjx-commonlibs/MediaCompressLib/local.properties b/zfsjx-commonlibs/MediaCompressLib/local.properties
new file mode 100644
index 00000000..9d5232e4
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/local.properties
@@ -0,0 +1,11 @@
+## This file is automatically generated by Android Studio.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must *NOT* be checked into Version Control Systems,
+# as it contains information specific to your local configuration.
+#
+# Location of the SDK. This is only used by Gradle.
+# For customization when using a Version Control System, please read the
+# header note.
+#Wed Apr 24 07:09:55 CST 2019
+sdk.dir=C\:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk
diff --git a/zfsjx-commonlibs/MediaCompressLib/proguard-rules.pro b/zfsjx-commonlibs/MediaCompressLib/proguard-rules.pro
new file mode 100644
index 00000000..41afecb1
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in D:\Android\sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/AndroidManifest.xml b/zfsjx-commonlibs/MediaCompressLib/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..a66550ce
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/AndroidManifest.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/java/com/sherry/ffmpegdemo/FfmpegKit.java b/zfsjx-commonlibs/MediaCompressLib/src/main/java/com/sherry/ffmpegdemo/FfmpegKit.java
new file mode 100644
index 00000000..898a2310
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/java/com/sherry/ffmpegdemo/FfmpegKit.java
@@ -0,0 +1,46 @@
+package com.sherry.ffmpegdemo;
+
+/**
+ * 压缩工具类
+ *
+ * Created by shanxs on 2017/5/27.
+ */
+public class FfmpegKit {
+ static{
+ System.loadLibrary("ffmpegDemo");
+ }
+
+ private static OnExecListener listener;
+
+ /**
+ * 调用底层执行
+ * @param argv
+ * @return
+ */
+ public static native int run(String[] argv);
+
+ /**
+ * 执行ffmoeg命令
+ * @param cmds
+ * @param listener
+ */
+ public static void exec(String[] cmds, OnExecListener listener) {
+ FfmpegKit.listener = listener;
+ run(cmds);
+ }
+
+ public static void onExecuted(int ret) {
+ if (listener != null) {
+ listener.onExecuted(ret);
+ }
+ }
+
+ /**
+ * 执行完成/错误 时的回调接口
+ */
+ public interface OnExecListener {
+ void onExecuted(int ret);
+ }
+
+ public static native String configure();
+}
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/java/com_sherry_ffmpegdemo_FfmpegKit.h b/zfsjx-commonlibs/MediaCompressLib/src/main/java/com_sherry_ffmpegdemo_FfmpegKit.h
new file mode 100644
index 00000000..51299b03
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/java/com_sherry_ffmpegdemo_FfmpegKit.h
@@ -0,0 +1,37 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include
+/* Header for class com_sherry_ffmpegdemo_FfmpegKit */
+
+#ifndef _Included_com_sherry_ffmpegdemo_FfmpegKit
+#define _Included_com_sherry_ffmpegdemo_FfmpegKit
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: com_sherry_ffmpegdemo_FfmpegKit
+ * Method: run
+ * Signature: ([Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_com_sherry_ffmpegdemo_FfmpegKit_run
+ (JNIEnv *, jclass, jobjectArray);
+
+/*
+ * Class: com_sherry_ffmpegdemo_FfmpegKit
+ * Method: configure
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_sherry_ffmpegdemo_FfmpegKit_configure
+ (JNIEnv *, jclass);
+
+/*
+ * Class: com_sherry_ffmpegdemo_FfmpegKit
+ * Method: getSecret
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_sherry_ffmpegdemo_FfmpegKit_getSecret
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/java/com_sherry_ffmpegdemo_FfmpegKit_OnExecListener.h b/zfsjx-commonlibs/MediaCompressLib/src/main/java/com_sherry_ffmpegdemo_FfmpegKit_OnExecListener.h
new file mode 100644
index 00000000..8c8b1345
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/java/com_sherry_ffmpegdemo_FfmpegKit_OnExecListener.h
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include
+/* Header for class com_sherry_ffmpegdemo_FfmpegKit_OnExecListener */
+
+#ifndef _Included_com_sherry_ffmpegdemo_FfmpegKit_OnExecListener
+#define _Included_com_sherry_ffmpegdemo_FfmpegKit_OnExecListener
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/Android.mk b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/Android.mk
new file mode 100644
index 00000000..66ebf7a2
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/Android.mk
@@ -0,0 +1,86 @@
+LOCAL_PATH := $(call my-dir)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := avcodec
+LOCAL_SRC_FILES := libavcodec.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := avfilter
+LOCAL_SRC_FILES := libavfilter.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := avformat
+LOCAL_SRC_FILES := libavformat.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := avutil
+LOCAL_SRC_FILES := libavutil.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := postproc
+LOCAL_SRC_FILES := libpostproc.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := swresample
+LOCAL_SRC_FILES := libswresample.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := swscale
+LOCAL_SRC_FILES := libswscale.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# prepare libX
+include $(CLEAR_VARS)
+TARGET_ARCH_ABI := armeabi-v7a
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_MODULE := x264
+LOCAL_SRC_FILES := libx264.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+
+TARGET_ARCH_ABI := armeabi-v7a
+
+LOCAL_MODULE := ffmpegDemo
+LOCAL_SRC_FILES := ffmpegdemo.c \
+ cmdutils.c \
+ ffmpeg.c \
+ ffmpeg_opt.c \
+ ffmpeg_filter.c \
+ ffmpeg_thread.c \
+ stdatomic.c
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
+LOCAL_CFLAGS := -D__STDC_CONSTANT_MACROS -Wno-sign-compare -Wno-switch -Wno-pointer-sign -DHAVE_NEON=1 -mfpu=neon -mfloat-abi=softfp -fPIC -DANDROID
+
+LOCAL_STATIC_LIBRARIES := avfilter avformat avcodec swresample postproc swscale avutil x264
+LOCAL_LDLIBS := -L$(NDK_ROOT)/platforms/$(APP_PLATFORM)/arch-arm/usr/lib -L$(LOCAL_PATH) -llog -ljnigraphics -lz -ldl
+
+
+include $(BUILD_SHARED_LIBRARY)
\ No newline at end of file
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/Application.mk b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/Application.mk
new file mode 100644
index 00000000..ce41f979
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/Application.mk
@@ -0,0 +1,4 @@
+APP_STL := gnustl_static
+APP_LDFLAGS := -latomic
+APP_ABI := armeabi, armeabi-v7a
+APP_PLATFORM := android-14
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils.c b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils.c
new file mode 100644
index 00000000..c00f66ea
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils.c
@@ -0,0 +1,2274 @@
+/*
+ * Various utilities for command line tools
+ * Copyright (c) 2000-2003 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+/* Include only the enabled headers since some compilers (namely, Sun
+ Studio) will not omit unused inline functions and create undefined
+ references to libraries that are not being built. */
+
+#include "config.h"
+#include "ffmpeg_thread.h"
+/*sherry #include "compat/va_copy.h"*/
+#include "include/libavformat/avformat.h"
+#include "include/libavfilter/avfilter.h"
+/*sherry #include "include/libavdevice/avdevice.h" sherry */
+/*sherry #include "include/libavresample/avresample.h" sherry */
+#include "include/libswscale/swscale.h"
+#include "include/libswresample/swresample.h"
+/*sherry #include "include/libpostproc/postprocess.h" sherry */
+#include "include/libavutil/avassert.h"
+#include "include/libavutil/avstring.h"
+#include "include/libavutil/bprint.h"
+#include "include/libavutil/display.h"
+#include "include/libavutil/mathematics.h"
+#include "include/libavutil/imgutils.h"
+/*sherry #include "include/libavutil/libm.h" sherry */
+#include "include/libavutil/parseutils.h"
+#include "include/libavutil/pixdesc.h"
+#include "include/libavutil/eval.h"
+#include "include/libavutil/dict.h"
+#include "include/libavutil/opt.h"
+#include "include/libavutil/cpu.h"
+#include "include/libavutil/ffversion.h"
+#include "include/libavutil/version.h"
+#include "cmdutils.h"
+/* sherry #if CONFIG_NETWORK
+#include "include/libavformat/network.h"
+#endif sherry */
+#if HAVE_SYS_RESOURCE_H
+#include
+#include
+#endif
+#ifdef _WIN32
+#include
+#endif
+
+static int init_report(const char *env);
+
+AVDictionary *sws_dict;
+AVDictionary *swr_opts;
+AVDictionary *format_opts, *codec_opts, *resample_opts;
+
+static FILE *report_file;
+static int report_file_level = AV_LOG_DEBUG;
+int hide_banner = 0;
+
+enum show_muxdemuxers {
+ SHOW_DEFAULT,
+ SHOW_DEMUXERS,
+ SHOW_MUXERS,
+};
+
+void init_opts(void)
+{
+ av_dict_set(&sws_dict, "flags", "bicubic", 0);
+}
+
+void uninit_opts(void)
+{
+ av_dict_free(&swr_opts);
+ av_dict_free(&sws_dict);
+ av_dict_free(&format_opts);
+ av_dict_free(&codec_opts);
+ av_dict_free(&resample_opts);
+}
+
+void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
+{
+ vfprintf(stdout, fmt, vl);
+}
+
+static void log_callback_report(void *ptr, int level, const char *fmt, va_list vl)
+{
+ va_list vl2;
+ char line[1024];
+ static int print_prefix = 1;
+
+ va_copy(vl2, vl);
+ av_log_default_callback(ptr, level, fmt, vl);
+ av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix);
+ va_end(vl2);
+ if (report_file_level >= level) {
+ fputs(line, report_file);
+ fflush(report_file);
+ }
+}
+
+void init_dynload(void)
+{
+#ifdef _WIN32
+ /* Calling SetDllDirectory with the empty string (but not NULL) removes the
+ * current working directory from the DLL search path as a security pre-caution. */
+ SetDllDirectory("");
+#endif
+}
+
+static void (*program_exit)(int ret);
+
+void register_exit(void (*cb)(int ret))
+{
+ program_exit = cb;
+}
+
+void exit_program(int ret)
+{
+ if (program_exit) {
+ program_exit(ret);
+ }
+ //退出线程
+ ffmpeg_thread_exit(ret);
+// exit(ret);
+}
+
+double parse_number_or_die(const char *context, const char *numstr, int type,
+ double min, double max)
+{
+ char *tail;
+ const char *error;
+ double d = av_strtod(numstr, &tail);
+ if (*tail)
+ error = "Expected number for %s but found: %s\n";
+ else if (d < min || d > max)
+ error = "The value for %s was %s which is not within %f - %f\n";
+ else if (type == OPT_INT64 && (int64_t)d != d)
+ error = "Expected int64 for %s but found %s\n";
+ else if (type == OPT_INT && (int)d != d)
+ error = "Expected int for %s but found %s\n";
+ else
+ return d;
+ av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max);
+ exit_program(1);
+ return 0;
+}
+
+int64_t parse_time_or_die(const char *context, const char *timestr,
+ int is_duration)
+{
+ int64_t us;
+ if (av_parse_time(&us, timestr, is_duration) < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Invalid %s specification for %s: %s\n",
+ is_duration ? "duration" : "date", context, timestr);
+ exit_program(1);
+ }
+ return us;
+}
+
+void show_help_options(const OptionDef *options, const char *msg, int req_flags,
+ int rej_flags, int alt_flags)
+{
+ const OptionDef *po;
+ int first;
+
+ first = 1;
+ for (po = options; po->name; po++) {
+ char buf[64];
+
+ if (((po->flags & req_flags) != req_flags) ||
+ (alt_flags && !(po->flags & alt_flags)) ||
+ (po->flags & rej_flags))
+ continue;
+
+ if (first) {
+ printf("%s\n", msg);
+ first = 0;
+ }
+ av_strlcpy(buf, po->name, sizeof(buf));
+ if (po->argname) {
+ av_strlcat(buf, " ", sizeof(buf));
+ av_strlcat(buf, po->argname, sizeof(buf));
+ }
+ printf("-%-17s %s\n", buf, po->help);
+ }
+ printf("\n");
+}
+
+void show_help_children(const AVClass *class, int flags)
+{
+ const AVClass *child = NULL;
+ if (class->option) {
+ av_opt_show2(&class, NULL, flags, 0);
+ printf("\n");
+ }
+
+ while (child = av_opt_child_class_next(class, child))
+ show_help_children(child, flags);
+}
+
+static const OptionDef *find_option(const OptionDef *po, const char *name)
+{
+ const char *p = strchr(name, ':');
+ int len = p ? p - name : strlen(name);
+
+ while (po->name) {
+ if (!strncmp(name, po->name, len) && strlen(po->name) == len)
+ break;
+ po++;
+ }
+ return po;
+}
+
+/* _WIN32 means using the windows libc - cygwin doesn't define that
+ * by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while
+ * it doesn't provide the actual command line via GetCommandLineW(). */
+#if HAVE_COMMANDLINETOARGVW && defined(_WIN32)
+#include
+/* Will be leaked on exit */
+static char** win32_argv_utf8 = NULL;
+static int win32_argc = 0;
+
+/**
+ * Prepare command line arguments for executable.
+ * For Windows - perform wide-char to UTF-8 conversion.
+ * Input arguments should be main() function arguments.
+ * @param argc_ptr Arguments number (including executable)
+ * @param argv_ptr Arguments list.
+ */
+static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
+{
+ char *argstr_flat;
+ wchar_t **argv_w;
+ int i, buffsize = 0, offset = 0;
+
+ if (win32_argv_utf8) {
+ *argc_ptr = win32_argc;
+ *argv_ptr = win32_argv_utf8;
+ return;
+ }
+
+ win32_argc = 0;
+ argv_w = CommandLineToArgvW(GetCommandLineW(), &win32_argc);
+ if (win32_argc <= 0 || !argv_w)
+ return;
+
+ /* determine the UTF-8 buffer size (including NULL-termination symbols) */
+ for (i = 0; i < win32_argc; i++)
+ buffsize += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
+ NULL, 0, NULL, NULL);
+
+ win32_argv_utf8 = av_mallocz(sizeof(char *) * (win32_argc + 1) + buffsize);
+ argstr_flat = (char *)win32_argv_utf8 + sizeof(char *) * (win32_argc + 1);
+ if (!win32_argv_utf8) {
+ LocalFree(argv_w);
+ return;
+ }
+
+ for (i = 0; i < win32_argc; i++) {
+ win32_argv_utf8[i] = &argstr_flat[offset];
+ offset += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
+ &argstr_flat[offset],
+ buffsize - offset, NULL, NULL);
+ }
+ win32_argv_utf8[i] = NULL;
+ LocalFree(argv_w);
+
+ *argc_ptr = win32_argc;
+ *argv_ptr = win32_argv_utf8;
+}
+#else
+static inline void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
+{
+ /* nothing to do */
+}
+#endif /* HAVE_COMMANDLINETOARGVW */
+
+static int write_option(void *optctx, const OptionDef *po, const char *opt,
+ const char *arg)
+{
+ /* new-style options contain an offset into optctx, old-style address of
+ * a global var*/
+ void *dst = po->flags & (OPT_OFFSET | OPT_SPEC) ?
+ (uint8_t *)optctx + po->u.off : po->u.dst_ptr;
+ int *dstcount;
+
+ if (po->flags & OPT_SPEC) {
+ SpecifierOpt **so = dst;
+ char *p = strchr(opt, ':');
+ char *str;
+
+ dstcount = (int *)(so + 1);
+ *so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1);
+ str = av_strdup(p ? p + 1 : "");
+ if (!str)
+ return AVERROR(ENOMEM);
+ (*so)[*dstcount - 1].specifier = str;
+ dst = &(*so)[*dstcount - 1].u;
+ }
+
+ if (po->flags & OPT_STRING) {
+ char *str;
+ str = av_strdup(arg);
+ av_freep(dst);
+ if (!str)
+ return AVERROR(ENOMEM);
+ *(char **)dst = str;
+ } else if (po->flags & OPT_BOOL || po->flags & OPT_INT) {
+ *(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
+ } else if (po->flags & OPT_INT64) {
+ *(int64_t *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX);
+ } else if (po->flags & OPT_TIME) {
+ *(int64_t *)dst = parse_time_or_die(opt, arg, 1);
+ } else if (po->flags & OPT_FLOAT) {
+ *(float *)dst = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
+ } else if (po->flags & OPT_DOUBLE) {
+ *(double *)dst = parse_number_or_die(opt, arg, OPT_DOUBLE, -INFINITY, INFINITY);
+ } else if (po->u.func_arg) {
+ int ret = po->u.func_arg(optctx, opt, arg);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Failed to set value '%s' for option '%s': %s\n",
+ arg, opt, av_err2str(ret));
+ return ret;
+ }
+ }
+ if (po->flags & OPT_EXIT)
+ exit_program(0);
+
+ return 0;
+}
+
+int parse_option(void *optctx, const char *opt, const char *arg,
+ const OptionDef *options)
+{
+ const OptionDef *po;
+ int ret;
+
+ po = find_option(options, opt);
+ if (!po->name && opt[0] == 'n' && opt[1] == 'o') {
+ /* handle 'no' bool option */
+ po = find_option(options, opt + 2);
+ if ((po->name && (po->flags & OPT_BOOL)))
+ arg = "0";
+ } else if (po->flags & OPT_BOOL)
+ arg = "1";
+
+ if (!po->name)
+ po = find_option(options, "default");
+ if (!po->name) {
+ av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt);
+ return AVERROR(EINVAL);
+ }
+ if (po->flags & HAS_ARG && !arg) {
+ av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'\n", opt);
+ return AVERROR(EINVAL);
+ }
+
+ ret = write_option(optctx, po, opt, arg);
+ if (ret < 0)
+ return ret;
+
+ return !!(po->flags & HAS_ARG);
+}
+
+void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
+ void (*parse_arg_function)(void *, const char*))
+{
+ const char *opt;
+ int optindex, handleoptions = 1, ret;
+
+ /* perform system-dependent conversions for arguments list */
+ prepare_app_arguments(&argc, &argv);
+
+ /* parse options */
+ optindex = 1;
+ while (optindex < argc) {
+ opt = argv[optindex++];
+
+ if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
+ if (opt[1] == '-' && opt[2] == '\0') {
+ handleoptions = 0;
+ continue;
+ }
+ opt++;
+
+ if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0)
+ exit_program(1);
+ optindex += ret;
+ } else {
+ if (parse_arg_function)
+ parse_arg_function(optctx, opt);
+ }
+ }
+}
+
+int parse_optgroup(void *optctx, OptionGroup *g)
+{
+ int i, ret;
+
+ av_log(NULL, AV_LOG_DEBUG, "Parsing a group of options: %s %s.\n",
+ g->group_def->name, g->arg);
+
+ for (i = 0; i < g->nb_opts; i++) {
+ Option *o = &g->opts[i];
+
+ if (g->group_def->flags &&
+ !(g->group_def->flags & o->opt->flags)) {
+ av_log(NULL, AV_LOG_ERROR, "Option %s (%s) cannot be applied to "
+ "%s %s -- you are trying to apply an input option to an "
+ "output file or vice versa. Move this option before the "
+ "file it belongs to.\n", o->key, o->opt->help,
+ g->group_def->name, g->arg);
+ return AVERROR(EINVAL);
+ }
+
+ av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n",
+ o->key, o->opt->help, o->val);
+
+ ret = write_option(optctx, o->opt, o->key, o->val);
+ if (ret < 0)
+ return ret;
+ }
+
+ av_log(NULL, AV_LOG_DEBUG, "Successfully parsed a group of options.\n");
+
+ return 0;
+}
+
+int locate_option(int argc, char **argv, const OptionDef *options,
+ const char *optname)
+{
+ const OptionDef *po;
+ int i;
+
+ for (i = 1; i < argc; i++) {
+ const char *cur_opt = argv[i];
+
+ if (*cur_opt++ != '-')
+ continue;
+
+ po = find_option(options, cur_opt);
+ if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o')
+ po = find_option(options, cur_opt + 2);
+
+ if ((!po->name && !strcmp(cur_opt, optname)) ||
+ (po->name && !strcmp(optname, po->name)))
+ return i;
+
+ if (!po->name || po->flags & HAS_ARG)
+ i++;
+ }
+ return 0;
+}
+
+static void dump_argument(const char *a)
+{
+ const unsigned char *p;
+
+ for (p = a; *p; p++)
+ if (!((*p >= '+' && *p <= ':') || (*p >= '@' && *p <= 'Z') ||
+ *p == '_' || (*p >= 'a' && *p <= 'z')))
+ break;
+ if (!*p) {
+ fputs(a, report_file);
+ return;
+ }
+ fputc('"', report_file);
+ for (p = a; *p; p++) {
+ if (*p == '\\' || *p == '"' || *p == '$' || *p == '`')
+ fprintf(report_file, "\\%c", *p);
+ else if (*p < ' ' || *p > '~')
+ fprintf(report_file, "\\x%02x", *p);
+ else
+ fputc(*p, report_file);
+ }
+ fputc('"', report_file);
+}
+
+static void check_options(const OptionDef *po)
+{
+ while (po->name) {
+ if (po->flags & OPT_PERFILE)
+ av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT));
+ po++;
+ }
+}
+
+void parse_loglevel(int argc, char **argv, const OptionDef *options)
+{
+ int idx = locate_option(argc, argv, options, "loglevel");
+ const char *env;
+
+ check_options(options);
+
+ if (!idx)
+ idx = locate_option(argc, argv, options, "v");
+ if (idx && argv[idx + 1])
+ opt_loglevel(NULL, "loglevel", argv[idx + 1]);
+ idx = locate_option(argc, argv, options, "report");
+ if ((env = getenv("FFREPORT")) || idx) {
+ init_report(env);
+ if (report_file) {
+ int i;
+ fprintf(report_file, "Command line:\n");
+ for (i = 0; i < argc; i++) {
+ dump_argument(argv[i]);
+ fputc(i < argc - 1 ? ' ' : '\n', report_file);
+ }
+ fflush(report_file);
+ }
+ }
+ idx = locate_option(argc, argv, options, "hide_banner");
+ if (idx)
+ hide_banner = 1;
+}
+
+static const AVOption *opt_find(void *obj, const char *name, const char *unit,
+ int opt_flags, int search_flags)
+{
+ const AVOption *o = av_opt_find(obj, name, unit, opt_flags, search_flags);
+ if(o && !o->flags)
+ return NULL;
+ return o;
+}
+
+#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0
+int opt_default(void *optctx, const char *opt, const char *arg)
+{
+ const AVOption *o;
+ int consumed = 0;
+ char opt_stripped[128];
+ const char *p;
+ const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
+#if CONFIG_AVRESAMPLE
+ const AVClass *rc = avresample_get_class();
+#endif
+#if CONFIG_SWSCALE
+ const AVClass *sc = sws_get_class();
+#endif
+#if CONFIG_SWRESAMPLE
+ const AVClass *swr_class = swr_get_class();
+#endif
+
+ if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
+ av_log_set_level(AV_LOG_DEBUG);
+
+ if (!(p = strchr(opt, ':')))
+ p = opt + strlen(opt);
+ av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));
+
+ if ((o = opt_find(&cc, opt_stripped, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||
+ ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
+ (o = opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)))) {
+ av_dict_set(&codec_opts, opt, arg, FLAGS);
+ consumed = 1;
+ }
+ if ((o = opt_find(&fc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
+ av_dict_set(&format_opts, opt, arg, FLAGS);
+ if (consumed)
+ av_log(NULL, AV_LOG_VERBOSE, "Routing option %s to both codec and muxer layer\n", opt);
+ consumed = 1;
+ }
+#if CONFIG_SWSCALE
+ if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
+ struct SwsContext *sws = sws_alloc_context();
+ int ret = av_opt_set(sws, opt, arg, 0);
+ sws_freeContext(sws);
+ if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
+ !strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
+ !strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
+ av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
+ return AVERROR(EINVAL);
+ }
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
+ return ret;
+ }
+
+ av_dict_set(&sws_dict, opt, arg, FLAGS);
+
+ consumed = 1;
+ }
+#else
+ if (!consumed && !strcmp(opt, "sws_flags")) {
+ av_log(NULL, AV_LOG_WARNING, "Ignoring %s %s, due to disabled swscale\n", opt, arg);
+ consumed = 1;
+ }
+#endif
+#if CONFIG_SWRESAMPLE
+ if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
+ struct SwrContext *swr = swr_alloc();
+ int ret = av_opt_set(swr, opt, arg, 0);
+ swr_free(&swr);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
+ return ret;
+ }
+ av_dict_set(&swr_opts, opt, arg, FLAGS);
+ consumed = 1;
+ }
+#endif
+#if CONFIG_AVRESAMPLE
+ if ((o=opt_find(&rc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
+ av_dict_set(&resample_opts, opt, arg, FLAGS);
+ consumed = 1;
+ }
+#endif
+
+ if (consumed)
+ return 0;
+ return AVERROR_OPTION_NOT_FOUND;
+}
+
+/*
+ * Check whether given option is a group separator.
+ *
+ * @return index of the group definition that matched or -1 if none
+ */
+static int match_group_separator(const OptionGroupDef *groups, int nb_groups,
+ const char *opt)
+{
+ int i;
+
+ for (i = 0; i < nb_groups; i++) {
+ const OptionGroupDef *p = &groups[i];
+ if (p->sep && !strcmp(p->sep, opt))
+ return i;
+ }
+
+ return -1;
+}
+
+/*
+ * Finish parsing an option group.
+ *
+ * @param group_idx which group definition should this group belong to
+ * @param arg argument of the group delimiting option
+ */
+static void finish_group(OptionParseContext *octx, int group_idx,
+ const char *arg)
+{
+ OptionGroupList *l = &octx->groups[group_idx];
+ OptionGroup *g;
+
+ GROW_ARRAY(l->groups, l->nb_groups);
+ g = &l->groups[l->nb_groups - 1];
+
+ *g = octx->cur_group;
+ g->arg = arg;
+ g->group_def = l->group_def;
+ g->sws_dict = sws_dict;
+ g->swr_opts = swr_opts;
+ g->codec_opts = codec_opts;
+ g->format_opts = format_opts;
+ g->resample_opts = resample_opts;
+
+ codec_opts = NULL;
+ format_opts = NULL;
+ resample_opts = NULL;
+ sws_dict = NULL;
+ swr_opts = NULL;
+ init_opts();
+
+ memset(&octx->cur_group, 0, sizeof(octx->cur_group));
+}
+
+/*
+ * Add an option instance to currently parsed group.
+ */
+static void add_opt(OptionParseContext *octx, const OptionDef *opt,
+ const char *key, const char *val)
+{
+ int global = !(opt->flags & (OPT_PERFILE | OPT_SPEC | OPT_OFFSET));
+ OptionGroup *g = global ? &octx->global_opts : &octx->cur_group;
+
+ GROW_ARRAY(g->opts, g->nb_opts);
+ g->opts[g->nb_opts - 1].opt = opt;
+ g->opts[g->nb_opts - 1].key = key;
+ g->opts[g->nb_opts - 1].val = val;
+}
+
+static void init_parse_context(OptionParseContext *octx,
+ const OptionGroupDef *groups, int nb_groups)
+{
+ static const OptionGroupDef global_group = { "global" };
+ int i;
+
+ memset(octx, 0, sizeof(*octx));
+
+ octx->nb_groups = nb_groups;
+ octx->groups = av_mallocz_array(octx->nb_groups, sizeof(*octx->groups));
+ if (!octx->groups)
+ exit_program(1);
+
+ for (i = 0; i < octx->nb_groups; i++)
+ octx->groups[i].group_def = &groups[i];
+
+ octx->global_opts.group_def = &global_group;
+ octx->global_opts.arg = "";
+
+ init_opts();
+}
+
+void uninit_parse_context(OptionParseContext *octx)
+{
+ int i, j;
+
+ for (i = 0; i < octx->nb_groups; i++) {
+ OptionGroupList *l = &octx->groups[i];
+
+ for (j = 0; j < l->nb_groups; j++) {
+ av_freep(&l->groups[j].opts);
+ av_dict_free(&l->groups[j].codec_opts);
+ av_dict_free(&l->groups[j].format_opts);
+ av_dict_free(&l->groups[j].resample_opts);
+
+ av_dict_free(&l->groups[j].sws_dict);
+ av_dict_free(&l->groups[j].swr_opts);
+ }
+ av_freep(&l->groups);
+ }
+ av_freep(&octx->groups);
+
+ av_freep(&octx->cur_group.opts);
+ av_freep(&octx->global_opts.opts);
+
+ uninit_opts();
+}
+
+int split_commandline(OptionParseContext *octx, int argc, char *argv[],
+ const OptionDef *options,
+ const OptionGroupDef *groups, int nb_groups)
+{
+ int optindex = 1;
+ int dashdash = -2;
+
+ /* perform system-dependent conversions for arguments list */
+ prepare_app_arguments(&argc, &argv);
+
+ init_parse_context(octx, groups, nb_groups);
+ av_log(NULL, AV_LOG_DEBUG, "Splitting the commandline.\n");
+
+ while (optindex < argc) {
+ const char *opt = argv[optindex++], *arg;
+ const OptionDef *po;
+ int ret;
+
+ av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
+
+ if (opt[0] == '-' && opt[1] == '-' && !opt[2]) {
+ dashdash = optindex;
+ continue;
+ }
+ /* unnamed group separators, e.g. output filename */
+ if (opt[0] != '-' || !opt[1] || dashdash+1 == optindex) {
+ finish_group(octx, 0, opt);
+ av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name);
+ continue;
+ }
+ opt++;
+
+#define GET_ARG(arg) \
+do { \
+ arg = argv[optindex++]; \
+ if (!arg) { \
+ av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'.\n", opt);\
+ return AVERROR(EINVAL); \
+ } \
+} while (0)
+
+ /* named group separators, e.g. -i */
+ if ((ret = match_group_separator(groups, nb_groups, opt)) >= 0) {
+ GET_ARG(arg);
+ finish_group(octx, ret, arg);
+ av_log(NULL, AV_LOG_DEBUG, " matched as %s with argument '%s'.\n",
+ groups[ret].name, arg);
+ continue;
+ }
+
+ /* normal options */
+ po = find_option(options, opt);
+ if (po->name) {
+ if (po->flags & OPT_EXIT) {
+ /* optional argument, e.g. -h */
+ arg = argv[optindex++];
+ } else if (po->flags & HAS_ARG) {
+ GET_ARG(arg);
+ } else {
+ arg = "1";
+ }
+
+ add_opt(octx, po, opt, arg);
+ av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with "
+ "argument '%s'.\n", po->name, po->help, arg);
+ continue;
+ }
+
+ /* AVOptions */
+ if (argv[optindex]) {
+ ret = opt_default(NULL, opt, argv[optindex]);
+ if (ret >= 0) {
+ av_log(NULL, AV_LOG_DEBUG, " matched as AVOption '%s' with "
+ "argument '%s'.\n", opt, argv[optindex]);
+ optindex++;
+ continue;
+ } else if (ret != AVERROR_OPTION_NOT_FOUND) {
+ av_log(NULL, AV_LOG_ERROR, "Error parsing option '%s' "
+ "with argument '%s'.\n", opt, argv[optindex]);
+ return ret;
+ }
+ }
+
+ /* boolean -nofoo options */
+ if (opt[0] == 'n' && opt[1] == 'o' &&
+ (po = find_option(options, opt + 2)) &&
+ po->name && po->flags & OPT_BOOL) {
+ add_opt(octx, po, opt, "0");
+ av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with "
+ "argument 0.\n", po->name, po->help);
+ continue;
+ }
+
+ av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'.\n", opt);
+ return AVERROR_OPTION_NOT_FOUND;
+ }
+
+ if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts)
+ av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the "
+ "commandline.\n");
+
+ av_log(NULL, AV_LOG_DEBUG, "Finished splitting the commandline.\n");
+
+ return 0;
+}
+
+int opt_cpuflags(void *optctx, const char *opt, const char *arg)
+{
+ int ret;
+ unsigned flags = av_get_cpu_flags();
+
+ if ((ret = av_parse_cpu_caps(&flags, arg)) < 0)
+ return ret;
+
+ av_force_cpu_flags(flags);
+ return 0;
+}
+
+int opt_loglevel(void *optctx, const char *opt, const char *arg)
+{
+ const struct { const char *name; int level; } log_levels[] = {
+ { "quiet" , AV_LOG_QUIET },
+ { "panic" , AV_LOG_PANIC },
+ { "fatal" , AV_LOG_FATAL },
+ { "error" , AV_LOG_ERROR },
+ { "warning", AV_LOG_WARNING },
+ { "info" , AV_LOG_INFO },
+ { "verbose", AV_LOG_VERBOSE },
+ { "debug" , AV_LOG_DEBUG },
+ { "trace" , AV_LOG_TRACE },
+ };
+ char *tail;
+ int level;
+ int flags;
+ int i;
+
+ flags = av_log_get_flags();
+ tail = strstr(arg, "repeat");
+ if (tail)
+ flags &= ~AV_LOG_SKIP_REPEATED;
+ else
+ flags |= AV_LOG_SKIP_REPEATED;
+
+ av_log_set_flags(flags);
+ if (tail == arg)
+ arg += 6 + (arg[6]=='+');
+ if(tail && !*arg)
+ return 0;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) {
+ if (!strcmp(log_levels[i].name, arg)) {
+ av_log_set_level(log_levels[i].level);
+ return 0;
+ }
+ }
+
+ level = strtol(arg, &tail, 10);
+ if (*tail) {
+ av_log(NULL, AV_LOG_FATAL, "Invalid loglevel \"%s\". "
+ "Possible levels are numbers or:\n", arg);
+ for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++)
+ av_log(NULL, AV_LOG_FATAL, "\"%s\"\n", log_levels[i].name);
+ exit_program(1);
+ }
+ av_log_set_level(level);
+ return 0;
+}
+
+static void expand_filename_template(AVBPrint *bp, const char *template,
+ struct tm *tm)
+{
+ int c;
+
+ while ((c = *(template++))) {
+ if (c == '%') {
+ if (!(c = *(template++)))
+ break;
+ switch (c) {
+ case 'p':
+ av_bprintf(bp, "%s", program_name);
+ break;
+ case 't':
+ av_bprintf(bp, "%04d%02d%02d-%02d%02d%02d",
+ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+ break;
+ case '%':
+ av_bprint_chars(bp, c, 1);
+ break;
+ }
+ } else {
+ av_bprint_chars(bp, c, 1);
+ }
+ }
+}
+
+static int init_report(const char *env)
+{
+ char *filename_template = NULL;
+ char *key, *val;
+ int ret, count = 0;
+ time_t now;
+ struct tm *tm;
+ AVBPrint filename;
+
+ if (report_file) /* already opened */
+ return 0;
+ time(&now);
+ tm = localtime(&now);
+
+ while (env && *env) {
+ if ((ret = av_opt_get_key_value(&env, "=", ":", 0, &key, &val)) < 0) {
+ if (count)
+ av_log(NULL, AV_LOG_ERROR,
+ "Failed to parse FFREPORT environment variable: %s\n",
+ av_err2str(ret));
+ break;
+ }
+ if (*env)
+ env++;
+ count++;
+ if (!strcmp(key, "file")) {
+ av_free(filename_template);
+ filename_template = val;
+ val = NULL;
+ } else if (!strcmp(key, "level")) {
+ char *tail;
+ report_file_level = strtol(val, &tail, 10);
+ if (*tail) {
+ av_log(NULL, AV_LOG_FATAL, "Invalid report file level\n");
+ exit_program(1);
+ }
+ } else {
+ av_log(NULL, AV_LOG_ERROR, "Unknown key '%s' in FFREPORT\n", key);
+ }
+ av_free(val);
+ av_free(key);
+ }
+
+ av_bprint_init(&filename, 0, 1);
+ expand_filename_template(&filename,
+ av_x_if_null(filename_template, "%p-%t.log"), tm);
+ av_free(filename_template);
+ if (!av_bprint_is_complete(&filename)) {
+ av_log(NULL, AV_LOG_ERROR, "Out of memory building report file name\n");
+ return AVERROR(ENOMEM);
+ }
+
+ report_file = fopen(filename.str, "w");
+ if (!report_file) {
+ int ret = AVERROR(errno);
+ av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n",
+ filename.str, strerror(errno));
+ return ret;
+ }
+ av_log_set_callback(log_callback_report);
+ av_log(NULL, AV_LOG_INFO,
+ "%s started on %04d-%02d-%02d at %02d:%02d:%02d\n"
+ "Report written to \"%s\"\n",
+ program_name,
+ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, tm->tm_sec,
+ filename.str);
+ av_bprint_finalize(&filename, NULL);
+ return 0;
+}
+
+int opt_report(const char *opt)
+{
+ return init_report(NULL);
+}
+
+int opt_max_alloc(void *optctx, const char *opt, const char *arg)
+{
+ char *tail;
+ size_t max;
+
+ max = strtol(arg, &tail, 10);
+ if (*tail) {
+ av_log(NULL, AV_LOG_FATAL, "Invalid max_alloc \"%s\".\n", arg);
+ exit_program(1);
+ }
+ av_max_alloc(max);
+ return 0;
+}
+
+int opt_timelimit(void *optctx, const char *opt, const char *arg)
+{
+#if HAVE_SETRLIMIT
+ int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
+ struct rlimit rl = { lim, lim + 1 };
+ if (setrlimit(RLIMIT_CPU, &rl))
+ perror("setrlimit");
+#else
+ av_log(NULL, AV_LOG_WARNING, "-%s not implemented on this OS\n", opt);
+#endif
+ return 0;
+}
+
+void print_error(const char *filename, int err)
+{
+ char errbuf[128];
+ const char *errbuf_ptr = errbuf;
+
+ if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
+ errbuf_ptr = strerror(AVUNERROR(err));
+ av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr);
+}
+
+static int warned_cfg = 0;
+
+#define INDENT 1
+#define SHOW_VERSION 2
+#define SHOW_CONFIG 4
+#define SHOW_COPYRIGHT 8
+
+#define PRINT_LIB_INFO(libname, LIBNAME, flags, level) \
+ if (CONFIG_##LIBNAME) { \
+ const char *indent = flags & INDENT? " " : ""; \
+ if (flags & SHOW_VERSION) { \
+ unsigned int version = libname##_version(); \
+ av_log(NULL, level, \
+ "%slib%-11s %2d.%3d.%3d / %2d.%3d.%3d\n", \
+ indent, #libname, \
+ AV_VERSION_MAJOR(version), AV_VERSION_MINOR(version),\
+ AV_VERSION_MICRO(version)); \
+ } \
+ if (flags & SHOW_CONFIG) { \
+ const char *cfg = libname##_configuration(); \
+ if (strcmp(FFMPEG_CONFIGURATION, cfg)) { \
+ if (!warned_cfg) { \
+ av_log(NULL, level, \
+ "%sWARNING: library configuration mismatch\n", \
+ indent); \
+ warned_cfg = 1; \
+ } \
+ av_log(NULL, level, "%s%-11s configuration: %s\n", \
+ indent, #libname, cfg); \
+ } \
+ } \
+ } \
+
+static void print_all_libs_info(int flags, int level)
+{
+ PRINT_LIB_INFO(avutil, AVUTIL, flags, level);
+ PRINT_LIB_INFO(avcodec, AVCODEC, flags, level);
+ PRINT_LIB_INFO(avformat, AVFORMAT, flags, level);
+ /* sherry PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level); sherry */
+ PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
+ PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level);
+ PRINT_LIB_INFO(swscale, SWSCALE, flags, level);
+ /* sherry PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level); sherry */
+ /* sherry PRINT_LIB_INFO(postproc, POSTPROC, flags, level); sherry */
+}
+
+static void print_program_info(int flags, int level)
+{
+ const char *indent = flags & INDENT? " " : "";
+
+ av_log(NULL, level, "%s version " FFMPEG_VERSION, program_name);
+ if (flags & SHOW_COPYRIGHT)
+ av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers",
+ program_birth_year, CONFIG_THIS_YEAR);
+ av_log(NULL, level, "\n");
+ av_log(NULL, level, "%sbuilt with %s\n", indent, CC_IDENT);
+
+ av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
+}
+
+static void print_buildconf(int flags, int level)
+{
+ const char *indent = flags & INDENT ? " " : "";
+ char str[] = { FFMPEG_CONFIGURATION };
+ char *conflist, *remove_tilde, *splitconf;
+
+ // Change all the ' --' strings to '~--' so that
+ // they can be identified as tokens.
+ while ((conflist = strstr(str, " --")) != NULL) {
+ strncpy(conflist, "~--", 3);
+ }
+
+ // Compensate for the weirdness this would cause
+ // when passing 'pkg-config --static'.
+ while ((remove_tilde = strstr(str, "pkg-config~")) != NULL) {
+ strncpy(remove_tilde, "pkg-config ", 11);
+ }
+
+ splitconf = strtok(str, "~");
+ av_log(NULL, level, "\n%sconfiguration:\n", indent);
+ while (splitconf != NULL) {
+ av_log(NULL, level, "%s%s%s\n", indent, indent, splitconf);
+ splitconf = strtok(NULL, "~");
+ }
+}
+
+void show_banner(int argc, char **argv, const OptionDef *options)
+{
+ int idx = locate_option(argc, argv, options, "version");
+ if (hide_banner || idx)
+ return;
+
+ print_program_info (INDENT|SHOW_COPYRIGHT, AV_LOG_INFO);
+ print_all_libs_info(INDENT|SHOW_CONFIG, AV_LOG_INFO);
+ print_all_libs_info(INDENT|SHOW_VERSION, AV_LOG_INFO);
+}
+
+int show_version(void *optctx, const char *opt, const char *arg)
+{
+ av_log_set_callback(log_callback_help);
+ print_program_info (SHOW_COPYRIGHT, AV_LOG_INFO);
+ print_all_libs_info(SHOW_VERSION, AV_LOG_INFO);
+
+ return 0;
+}
+
+int show_buildconf(void *optctx, const char *opt, const char *arg)
+{
+ av_log_set_callback(log_callback_help);
+ print_buildconf (INDENT|0, AV_LOG_INFO);
+
+ return 0;
+}
+
+int show_license(void *optctx, const char *opt, const char *arg)
+{
+#if CONFIG_NONFREE
+ printf(
+ "This version of %s has nonfree parts compiled in.\n"
+ "Therefore it is not legally redistributable.\n",
+ program_name );
+#elif CONFIG_GPLV3
+ printf(
+ "%s is free software; you can redistribute it and/or modify\n"
+ "it under the terms of the GNU General Public License as published by\n"
+ "the Free Software Foundation; either version 3 of the License, or\n"
+ "(at your option) any later version.\n"
+ "\n"
+ "%s is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "GNU General Public License for more details.\n"
+ "\n"
+ "You should have received a copy of the GNU General Public License\n"
+ "along with %s. If not, see .\n",
+ program_name, program_name, program_name );
+#elif CONFIG_GPL
+ printf(
+ "%s is free software; you can redistribute it and/or modify\n"
+ "it under the terms of the GNU General Public License as published by\n"
+ "the Free Software Foundation; either version 2 of the License, or\n"
+ "(at your option) any later version.\n"
+ "\n"
+ "%s is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "GNU General Public License for more details.\n"
+ "\n"
+ "You should have received a copy of the GNU General Public License\n"
+ "along with %s; if not, write to the Free Software\n"
+ "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n",
+ program_name, program_name, program_name );
+#elif CONFIG_LGPLV3
+ printf(
+ "%s is free software; you can redistribute it and/or modify\n"
+ "it under the terms of the GNU Lesser General Public License as published by\n"
+ "the Free Software Foundation; either version 3 of the License, or\n"
+ "(at your option) any later version.\n"
+ "\n"
+ "%s is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "GNU Lesser General Public License for more details.\n"
+ "\n"
+ "You should have received a copy of the GNU Lesser General Public License\n"
+ "along with %s. If not, see .\n",
+ program_name, program_name, program_name );
+#else
+ printf(
+ "%s is free software; you can redistribute it and/or\n"
+ "modify it under the terms of the GNU Lesser General Public\n"
+ "License as published by the Free Software Foundation; either\n"
+ "version 2.1 of the License, or (at your option) any later version.\n"
+ "\n"
+ "%s is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
+ "Lesser General Public License for more details.\n"
+ "\n"
+ "You should have received a copy of the GNU Lesser General Public\n"
+ "License along with %s; if not, write to the Free Software\n"
+ "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n",
+ program_name, program_name, program_name );
+#endif
+
+ return 0;
+}
+
+static int is_device(const AVClass *avclass)
+{
+ if (!avclass)
+ return 0;
+ return AV_IS_INPUT_DEVICE(avclass->category) || AV_IS_OUTPUT_DEVICE(avclass->category);
+}
+
+static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only, int muxdemuxers)
+{
+ AVInputFormat *ifmt = NULL;
+ AVOutputFormat *ofmt = NULL;
+ const char *last_name;
+ int is_dev;
+
+ printf("%s\n"
+ " D. = Demuxing supported\n"
+ " .E = Muxing supported\n"
+ " --\n", device_only ? "Devices:" : "File formats:");
+ last_name = "000";
+ for (;;) {
+ int decode = 0;
+ int encode = 0;
+ const char *name = NULL;
+ const char *long_name = NULL;
+
+ if (muxdemuxers !=SHOW_DEMUXERS) {
+ while ((ofmt = av_oformat_next(ofmt))) {
+ is_dev = is_device(ofmt->priv_class);
+ if (!is_dev && device_only)
+ continue;
+ if ((!name || strcmp(ofmt->name, name) < 0) &&
+ strcmp(ofmt->name, last_name) > 0) {
+ name = ofmt->name;
+ long_name = ofmt->long_name;
+ encode = 1;
+ }
+ }
+ }
+ if (muxdemuxers != SHOW_MUXERS) {
+ while ((ifmt = av_iformat_next(ifmt))) {
+ is_dev = is_device(ifmt->priv_class);
+ if (!is_dev && device_only)
+ continue;
+ if ((!name || strcmp(ifmt->name, name) < 0) &&
+ strcmp(ifmt->name, last_name) > 0) {
+ name = ifmt->name;
+ long_name = ifmt->long_name;
+ encode = 0;
+ }
+ if (name && strcmp(ifmt->name, name) == 0)
+ decode = 1;
+ }
+ }
+ if (!name)
+ break;
+ last_name = name;
+
+ printf(" %s%s %-15s %s\n",
+ decode ? "D" : " ",
+ encode ? "E" : " ",
+ name,
+ long_name ? long_name:" ");
+ }
+ return 0;
+}
+
+int show_formats(void *optctx, const char *opt, const char *arg)
+{
+ return show_formats_devices(optctx, opt, arg, 0, SHOW_DEFAULT);
+}
+
+int show_muxers(void *optctx, const char *opt, const char *arg)
+{
+ return show_formats_devices(optctx, opt, arg, 0, SHOW_MUXERS);
+}
+
+int show_demuxers(void *optctx, const char *opt, const char *arg)
+{
+ return show_formats_devices(optctx, opt, arg, 0, SHOW_DEMUXERS);
+}
+
+int show_devices(void *optctx, const char *opt, const char *arg)
+{
+ return show_formats_devices(optctx, opt, arg, 1, SHOW_DEFAULT);
+}
+
+#define PRINT_CODEC_SUPPORTED(codec, field, type, list_name, term, get_name) \
+ if (codec->field) { \
+ const type *p = codec->field; \
+ \
+ printf(" Supported " list_name ":"); \
+ while (*p != term) { \
+ get_name(*p); \
+ printf(" %s", name); \
+ p++; \
+ } \
+ printf("\n"); \
+ } \
+
+static void print_codec(const AVCodec *c)
+{
+ int encoder = av_codec_is_encoder(c);
+
+ printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
+ c->long_name ? c->long_name : "");
+
+ printf(" General capabilities: ");
+ if (c->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)
+ printf("horizband ");
+ if (c->capabilities & AV_CODEC_CAP_DR1)
+ printf("dr1 ");
+ if (c->capabilities & AV_CODEC_CAP_TRUNCATED)
+ printf("trunc ");
+ if (c->capabilities & AV_CODEC_CAP_DELAY)
+ printf("delay ");
+ if (c->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME)
+ printf("small ");
+ if (c->capabilities & AV_CODEC_CAP_SUBFRAMES)
+ printf("subframes ");
+ if (c->capabilities & AV_CODEC_CAP_EXPERIMENTAL)
+ printf("exp ");
+ if (c->capabilities & AV_CODEC_CAP_CHANNEL_CONF)
+ printf("chconf ");
+ if (c->capabilities & AV_CODEC_CAP_PARAM_CHANGE)
+ printf("paramchange ");
+ if (c->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
+ printf("variable ");
+ if (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
+ AV_CODEC_CAP_SLICE_THREADS |
+ AV_CODEC_CAP_AUTO_THREADS))
+ printf("threads ");
+ if (!c->capabilities)
+ printf("none");
+ printf("\n");
+
+ if (c->type == AVMEDIA_TYPE_VIDEO ||
+ c->type == AVMEDIA_TYPE_AUDIO) {
+ printf(" Threading capabilities: ");
+ switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
+ AV_CODEC_CAP_SLICE_THREADS |
+ AV_CODEC_CAP_AUTO_THREADS)) {
+ case AV_CODEC_CAP_FRAME_THREADS |
+ AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
+ case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break;
+ case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break;
+ case AV_CODEC_CAP_AUTO_THREADS : printf("auto"); break;
+ default: printf("none"); break;
+ }
+ printf("\n");
+ }
+
+ if (c->supported_framerates) {
+ const AVRational *fps = c->supported_framerates;
+
+ printf(" Supported framerates:");
+ while (fps->num) {
+ printf(" %d/%d", fps->num, fps->den);
+ fps++;
+ }
+ printf("\n");
+ }
+ PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats",
+ AV_PIX_FMT_NONE, GET_PIX_FMT_NAME);
+ PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0,
+ GET_SAMPLE_RATE_NAME);
+ PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats",
+ AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME);
+ PRINT_CODEC_SUPPORTED(c, channel_layouts, uint64_t, "channel layouts",
+ 0, GET_CH_LAYOUT_DESC);
+
+ if (c->priv_class) {
+ show_help_children(c->priv_class,
+ AV_OPT_FLAG_ENCODING_PARAM |
+ AV_OPT_FLAG_DECODING_PARAM);
+ }
+}
+
+static char get_media_type_char(enum AVMediaType type)
+{
+ switch (type) {
+ case AVMEDIA_TYPE_VIDEO: return 'V';
+ case AVMEDIA_TYPE_AUDIO: return 'A';
+ case AVMEDIA_TYPE_DATA: return 'D';
+ case AVMEDIA_TYPE_SUBTITLE: return 'S';
+ case AVMEDIA_TYPE_ATTACHMENT:return 'T';
+ default: return '?';
+ }
+}
+
+static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev,
+ int encoder)
+{
+ while ((prev = av_codec_next(prev))) {
+ if (prev->id == id &&
+ (encoder ? av_codec_is_encoder(prev) : av_codec_is_decoder(prev)))
+ return prev;
+ }
+ return NULL;
+}
+
+static int compare_codec_desc(const void *a, const void *b)
+{
+ const AVCodecDescriptor * const *da = a;
+ const AVCodecDescriptor * const *db = b;
+
+ return (*da)->type != (*db)->type ? FFDIFFSIGN((*da)->type, (*db)->type) :
+ strcmp((*da)->name, (*db)->name);
+}
+
+static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs)
+{
+ const AVCodecDescriptor *desc = NULL;
+ const AVCodecDescriptor **codecs;
+ unsigned nb_codecs = 0, i = 0;
+
+ while ((desc = avcodec_descriptor_next(desc)))
+ nb_codecs++;
+ if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) {
+ av_log(NULL, AV_LOG_ERROR, "Out of memory\n");
+ exit_program(1);
+ }
+ desc = NULL;
+ while ((desc = avcodec_descriptor_next(desc)))
+ codecs[i++] = desc;
+ av_assert0(i == nb_codecs);
+ qsort(codecs, nb_codecs, sizeof(*codecs), compare_codec_desc);
+ *rcodecs = codecs;
+ return nb_codecs;
+}
+
+static void print_codecs_for_id(enum AVCodecID id, int encoder)
+{
+ const AVCodec *codec = NULL;
+
+ printf(" (%s: ", encoder ? "encoders" : "decoders");
+
+ while ((codec = next_codec_for_id(id, codec, encoder)))
+ printf("%s ", codec->name);
+
+ printf(")");
+}
+
+int show_codecs(void *optctx, const char *opt, const char *arg)
+{
+ const AVCodecDescriptor **codecs;
+ unsigned i, nb_codecs = get_codecs_sorted(&codecs);
+
+ printf("Codecs:\n"
+ " D..... = Decoding supported\n"
+ " .E.... = Encoding supported\n"
+ " ..V... = Video codec\n"
+ " ..A... = Audio codec\n"
+ " ..S... = Subtitle codec\n"
+ " ...I.. = Intra frame-only codec\n"
+ " ....L. = Lossy compression\n"
+ " .....S = Lossless compression\n"
+ " -------\n");
+ for (i = 0; i < nb_codecs; i++) {
+ const AVCodecDescriptor *desc = codecs[i];
+ const AVCodec *codec = NULL;
+
+ if (strstr(desc->name, "_deprecated"))
+ continue;
+
+ printf(" ");
+ printf(avcodec_find_decoder(desc->id) ? "D" : ".");
+ printf(avcodec_find_encoder(desc->id) ? "E" : ".");
+
+ printf("%c", get_media_type_char(desc->type));
+ printf((desc->props & AV_CODEC_PROP_INTRA_ONLY) ? "I" : ".");
+ printf((desc->props & AV_CODEC_PROP_LOSSY) ? "L" : ".");
+ printf((desc->props & AV_CODEC_PROP_LOSSLESS) ? "S" : ".");
+
+ printf(" %-20s %s", desc->name, desc->long_name ? desc->long_name : "");
+
+ /* print decoders/encoders when there's more than one or their
+ * names are different from codec name */
+ while ((codec = next_codec_for_id(desc->id, codec, 0))) {
+ if (strcmp(codec->name, desc->name)) {
+ print_codecs_for_id(desc->id, 0);
+ break;
+ }
+ }
+ codec = NULL;
+ while ((codec = next_codec_for_id(desc->id, codec, 1))) {
+ if (strcmp(codec->name, desc->name)) {
+ print_codecs_for_id(desc->id, 1);
+ break;
+ }
+ }
+
+ printf("\n");
+ }
+ av_free(codecs);
+ return 0;
+}
+
+static void print_codecs(int encoder)
+{
+ const AVCodecDescriptor **codecs;
+ unsigned i, nb_codecs = get_codecs_sorted(&codecs);
+
+ printf("%s:\n"
+ " V..... = Video\n"
+ " A..... = Audio\n"
+ " S..... = Subtitle\n"
+ " .F.... = Frame-level multithreading\n"
+ " ..S... = Slice-level multithreading\n"
+ " ...X.. = Codec is experimental\n"
+ " ....B. = Supports draw_horiz_band\n"
+ " .....D = Supports direct rendering method 1\n"
+ " ------\n",
+ encoder ? "Encoders" : "Decoders");
+ for (i = 0; i < nb_codecs; i++) {
+ const AVCodecDescriptor *desc = codecs[i];
+ const AVCodec *codec = NULL;
+
+ while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
+ printf(" %c", get_media_type_char(desc->type));
+ printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_DR1) ? "D" : ".");
+
+ printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
+ if (strcmp(codec->name, desc->name))
+ printf(" (codec %s)", desc->name);
+
+ printf("\n");
+ }
+ }
+ av_free(codecs);
+}
+
+int show_decoders(void *optctx, const char *opt, const char *arg)
+{
+ print_codecs(0);
+ return 0;
+}
+
+int show_encoders(void *optctx, const char *opt, const char *arg)
+{
+ print_codecs(1);
+ return 0;
+}
+
+int show_bsfs(void *optctx, const char *opt, const char *arg)
+{
+ const AVBitStreamFilter *bsf = NULL;
+ void *opaque = NULL;
+
+ printf("Bitstream filters:\n");
+ while ((bsf = av_bsf_next(&opaque)))
+ printf("%s\n", bsf->name);
+ printf("\n");
+ return 0;
+}
+
+int show_protocols(void *optctx, const char *opt, const char *arg)
+{
+ void *opaque = NULL;
+ const char *name;
+
+ printf("Supported file protocols:\n"
+ "Input:\n");
+ while ((name = avio_enum_protocols(&opaque, 0)))
+ printf(" %s\n", name);
+ printf("Output:\n");
+ while ((name = avio_enum_protocols(&opaque, 1)))
+ printf(" %s\n", name);
+ return 0;
+}
+
+int show_filters(void *optctx, const char *opt, const char *arg)
+{
+#if CONFIG_AVFILTER
+ const AVFilter *filter = NULL;
+ char descr[64], *descr_cur;
+ int i, j;
+ const AVFilterPad *pad;
+
+ printf("Filters:\n"
+ " T.. = Timeline support\n"
+ " .S. = Slice threading\n"
+ " ..C = Command support\n"
+ " A = Audio input/output\n"
+ " V = Video input/output\n"
+ " N = Dynamic number and/or type of input/output\n"
+ " | = Source or sink filter\n");
+ while ((filter = avfilter_next(filter))) {
+ descr_cur = descr;
+ for (i = 0; i < 2; i++) {
+ if (i) {
+ *(descr_cur++) = '-';
+ *(descr_cur++) = '>';
+ }
+ pad = i ? filter->outputs : filter->inputs;
+ for (j = 0; pad && avfilter_pad_get_name(pad, j); j++) {
+ if (descr_cur >= descr + sizeof(descr) - 4)
+ break;
+ *(descr_cur++) = get_media_type_char(avfilter_pad_get_type(pad, j));
+ }
+ if (!j)
+ *(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) ||
+ ( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|';
+ }
+ *descr_cur = 0;
+ printf(" %c%c%c %-17s %-10s %s\n",
+ filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.',
+ filter->flags & AVFILTER_FLAG_SLICE_THREADS ? 'S' : '.',
+ filter->process_command ? 'C' : '.',
+ filter->name, descr, filter->description);
+ }
+#else
+ printf("No filters available: libavfilter disabled\n");
+#endif
+ return 0;
+}
+
+int show_colors(void *optctx, const char *opt, const char *arg)
+{
+ const char *name;
+ const uint8_t *rgb;
+ int i;
+
+ printf("%-32s #RRGGBB\n", "name");
+
+ for (i = 0; name = av_get_known_color_name(i, &rgb); i++)
+ printf("%-32s #%02x%02x%02x\n", name, rgb[0], rgb[1], rgb[2]);
+
+ return 0;
+}
+
+int show_pix_fmts(void *optctx, const char *opt, const char *arg)
+{
+ const AVPixFmtDescriptor *pix_desc = NULL;
+
+ printf("Pixel formats:\n"
+ "I.... = Supported Input format for conversion\n"
+ ".O... = Supported Output format for conversion\n"
+ "..H.. = Hardware accelerated format\n"
+ "...P. = Paletted format\n"
+ "....B = Bitstream format\n"
+ "FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL\n"
+ "-----\n");
+
+#if !CONFIG_SWSCALE
+# define sws_isSupportedInput(x) 0
+# define sws_isSupportedOutput(x) 0
+#endif
+
+ while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
+ enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
+ printf("%c%c%c%c%c %-16s %d %2d\n",
+ sws_isSupportedInput (pix_fmt) ? 'I' : '.',
+ sws_isSupportedOutput(pix_fmt) ? 'O' : '.',
+ pix_desc->flags & AV_PIX_FMT_FLAG_HWACCEL ? 'H' : '.',
+ pix_desc->flags & AV_PIX_FMT_FLAG_PAL ? 'P' : '.',
+ pix_desc->flags & AV_PIX_FMT_FLAG_BITSTREAM ? 'B' : '.',
+ pix_desc->name,
+ pix_desc->nb_components,
+ av_get_bits_per_pixel(pix_desc));
+ }
+ return 0;
+}
+
+int show_layouts(void *optctx, const char *opt, const char *arg)
+{
+ int i = 0;
+ uint64_t layout, j;
+ const char *name, *descr;
+
+ printf("Individual channels:\n"
+ "NAME DESCRIPTION\n");
+ for (i = 0; i < 63; i++) {
+ name = av_get_channel_name((uint64_t)1 << i);
+ if (!name)
+ continue;
+ descr = av_get_channel_description((uint64_t)1 << i);
+ printf("%-14s %s\n", name, descr);
+ }
+ printf("\nStandard channel layouts:\n"
+ "NAME DECOMPOSITION\n");
+ for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) {
+ if (name) {
+ printf("%-14s ", name);
+ for (j = 1; j; j <<= 1)
+ if ((layout & j))
+ printf("%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j));
+ printf("\n");
+ }
+ }
+ return 0;
+}
+
+int show_sample_fmts(void *optctx, const char *opt, const char *arg)
+{
+ int i;
+ char fmt_str[128];
+ for (i = -1; i < AV_SAMPLE_FMT_NB; i++)
+ printf("%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i));
+ return 0;
+}
+
+static void show_help_codec(const char *name, int encoder)
+{
+ const AVCodecDescriptor *desc;
+ const AVCodec *codec;
+
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No codec name specified.\n");
+ return;
+ }
+
+ codec = encoder ? avcodec_find_encoder_by_name(name) :
+ avcodec_find_decoder_by_name(name);
+
+ if (codec)
+ print_codec(codec);
+ else if ((desc = avcodec_descriptor_get_by_name(name))) {
+ int printed = 0;
+
+ while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
+ printed = 1;
+ print_codec(codec);
+ }
+
+ if (!printed) {
+ av_log(NULL, AV_LOG_ERROR, "Codec '%s' is known to FFmpeg, "
+ "but no %s for it are available. FFmpeg might need to be "
+ "recompiled with additional external libraries.\n",
+ name, encoder ? "encoders" : "decoders");
+ }
+ } else {
+ av_log(NULL, AV_LOG_ERROR, "Codec '%s' is not recognized by FFmpeg.\n",
+ name);
+ }
+}
+
+static void show_help_demuxer(const char *name)
+{
+ const AVInputFormat *fmt = av_find_input_format(name);
+
+ if (!fmt) {
+ av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
+ return;
+ }
+
+ printf("Demuxer %s [%s]:\n", fmt->name, fmt->long_name);
+
+ if (fmt->extensions)
+ printf(" Common extensions: %s.\n", fmt->extensions);
+
+ if (fmt->priv_class)
+ show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM);
+}
+
+static void show_help_muxer(const char *name)
+{
+ const AVCodecDescriptor *desc;
+ const AVOutputFormat *fmt = av_guess_format(name, NULL, NULL);
+
+ if (!fmt) {
+ av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
+ return;
+ }
+
+ printf("Muxer %s [%s]:\n", fmt->name, fmt->long_name);
+
+ if (fmt->extensions)
+ printf(" Common extensions: %s.\n", fmt->extensions);
+ if (fmt->mime_type)
+ printf(" Mime type: %s.\n", fmt->mime_type);
+ if (fmt->video_codec != AV_CODEC_ID_NONE &&
+ (desc = avcodec_descriptor_get(fmt->video_codec))) {
+ printf(" Default video codec: %s.\n", desc->name);
+ }
+ if (fmt->audio_codec != AV_CODEC_ID_NONE &&
+ (desc = avcodec_descriptor_get(fmt->audio_codec))) {
+ printf(" Default audio codec: %s.\n", desc->name);
+ }
+ if (fmt->subtitle_codec != AV_CODEC_ID_NONE &&
+ (desc = avcodec_descriptor_get(fmt->subtitle_codec))) {
+ printf(" Default subtitle codec: %s.\n", desc->name);
+ }
+
+ if (fmt->priv_class)
+ show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM);
+}
+
+#if CONFIG_AVFILTER
+static void show_help_filter(const char *name)
+{
+#if CONFIG_AVFILTER
+ const AVFilter *f = avfilter_get_by_name(name);
+ int i, count;
+
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
+ return;
+ } else if (!f) {
+ av_log(NULL, AV_LOG_ERROR, "Unknown filter '%s'.\n", name);
+ return;
+ }
+
+ printf("Filter %s\n", f->name);
+ if (f->description)
+ printf(" %s\n", f->description);
+
+ if (f->flags & AVFILTER_FLAG_SLICE_THREADS)
+ printf(" slice threading supported\n");
+
+ printf(" Inputs:\n");
+ count = avfilter_pad_count(f->inputs);
+ for (i = 0; i < count; i++) {
+ printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->inputs, i),
+ media_type_string(avfilter_pad_get_type(f->inputs, i)));
+ }
+ if (f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)
+ printf(" dynamic (depending on the options)\n");
+ else if (!count)
+ printf(" none (source filter)\n");
+
+ printf(" Outputs:\n");
+ count = avfilter_pad_count(f->outputs);
+ for (i = 0; i < count; i++) {
+ printf(" #%d: %s (%s)\n", i, avfilter_pad_get_name(f->outputs, i),
+ media_type_string(avfilter_pad_get_type(f->outputs, i)));
+ }
+ if (f->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS)
+ printf(" dynamic (depending on the options)\n");
+ else if (!count)
+ printf(" none (sink filter)\n");
+
+ if (f->priv_class)
+ show_help_children(f->priv_class, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM |
+ AV_OPT_FLAG_AUDIO_PARAM);
+ if (f->flags & AVFILTER_FLAG_SUPPORT_TIMELINE)
+ printf("This filter has support for timeline through the 'enable' option.\n");
+#else
+ av_log(NULL, AV_LOG_ERROR, "Build without libavfilter; "
+ "can not to satisfy request\n");
+#endif
+}
+#endif
+
+int show_help(void *optctx, const char *opt, const char *arg)
+{
+ char *topic, *par;
+ av_log_set_callback(log_callback_help);
+
+ topic = av_strdup(arg ? arg : "");
+ if (!topic)
+ return AVERROR(ENOMEM);
+ par = strchr(topic, '=');
+ if (par)
+ *par++ = 0;
+
+ if (!*topic) {
+ show_help_default(topic, par);
+ } else if (!strcmp(topic, "decoder")) {
+ show_help_codec(par, 0);
+ } else if (!strcmp(topic, "encoder")) {
+ show_help_codec(par, 1);
+ } else if (!strcmp(topic, "demuxer")) {
+ show_help_demuxer(par);
+ } else if (!strcmp(topic, "muxer")) {
+ show_help_muxer(par);
+#if CONFIG_AVFILTER
+ } else if (!strcmp(topic, "filter")) {
+ show_help_filter(par);
+#endif
+ } else {
+ show_help_default(topic, par);
+ }
+
+ av_freep(&topic);
+ return 0;
+}
+
+int read_yesno(void)
+{
+ int c = getchar();
+ int yesno = (av_toupper(c) == 'Y');
+
+ while (c != '\n' && c != EOF)
+ c = getchar();
+
+ return yesno;
+}
+
+FILE *get_preset_file(char *filename, size_t filename_size,
+ const char *preset_name, int is_path,
+ const char *codec_name)
+{
+ FILE *f = NULL;
+ int i;
+ const char *base[3] = { getenv("FFMPEG_DATADIR"),
+ getenv("HOME"),
+ FFMPEG_DATADIR, };
+
+ if (is_path) {
+ av_strlcpy(filename, preset_name, filename_size);
+ f = fopen(filename, "r");
+ } else {
+#ifdef _WIN32
+ char datadir[MAX_PATH], *ls;
+ base[2] = NULL;
+
+ if (GetModuleFileNameA(GetModuleHandleA(NULL), datadir, sizeof(datadir) - 1))
+ {
+ for (ls = datadir; ls < datadir + strlen(datadir); ls++)
+ if (*ls == '\\') *ls = '/';
+
+ if (ls = strrchr(datadir, '/'))
+ {
+ *ls = 0;
+ strncat(datadir, "/ffpresets", sizeof(datadir) - 1 - strlen(datadir));
+ base[2] = datadir;
+ }
+ }
+#endif
+ for (i = 0; i < 3 && !f; i++) {
+ if (!base[i])
+ continue;
+ snprintf(filename, filename_size, "%s%s/%s.ffpreset", base[i],
+ i != 1 ? "" : "/.ffmpeg", preset_name);
+ f = fopen(filename, "r");
+ if (!f && codec_name) {
+ snprintf(filename, filename_size,
+ "%s%s/%s-%s.ffpreset",
+ base[i], i != 1 ? "" : "/.ffmpeg", codec_name,
+ preset_name);
+ f = fopen(filename, "r");
+ }
+ }
+ }
+
+ return f;
+}
+
+int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
+{
+ int ret = avformat_match_stream_specifier(s, st, spec);
+ if (ret < 0)
+ av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec);
+ return ret;
+}
+
+AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
+ AVFormatContext *s, AVStream *st, AVCodec *codec)
+{
+ AVDictionary *ret = NULL;
+ AVDictionaryEntry *t = NULL;
+ int flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM
+ : AV_OPT_FLAG_DECODING_PARAM;
+ char prefix = 0;
+ const AVClass *cc = avcodec_get_class();
+
+ if (!codec)
+ codec = s->oformat ? avcodec_find_encoder(codec_id)
+ : avcodec_find_decoder(codec_id);
+
+ switch (st->codecpar->codec_type) {
+ case AVMEDIA_TYPE_VIDEO:
+ prefix = 'v';
+ flags |= AV_OPT_FLAG_VIDEO_PARAM;
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ prefix = 'a';
+ flags |= AV_OPT_FLAG_AUDIO_PARAM;
+ break;
+ case AVMEDIA_TYPE_SUBTITLE:
+ prefix = 's';
+ flags |= AV_OPT_FLAG_SUBTITLE_PARAM;
+ break;
+ }
+
+ while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) {
+ char *p = strchr(t->key, ':');
+
+ /* check stream specification in opt name */
+ if (p)
+ switch (check_stream_specifier(s, st, p + 1)) {
+ case 1: *p = 0; break;
+ case 0: continue;
+ default: exit_program(1);
+ }
+
+ if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
+ !codec ||
+ (codec->priv_class &&
+ av_opt_find(&codec->priv_class, t->key, NULL, flags,
+ AV_OPT_SEARCH_FAKE_OBJ)))
+ av_dict_set(&ret, t->key, t->value, 0);
+ else if (t->key[0] == prefix &&
+ av_opt_find(&cc, t->key + 1, NULL, flags,
+ AV_OPT_SEARCH_FAKE_OBJ))
+ av_dict_set(&ret, t->key + 1, t->value, 0);
+
+ if (p)
+ *p = ':';
+ }
+ return ret;
+}
+
+AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
+ AVDictionary *codec_opts)
+{
+ int i;
+ AVDictionary **opts;
+
+ if (!s->nb_streams)
+ return NULL;
+ opts = av_mallocz_array(s->nb_streams, sizeof(*opts));
+ if (!opts) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Could not alloc memory for stream options.\n");
+ return NULL;
+ }
+ for (i = 0; i < s->nb_streams; i++)
+ opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id,
+ s, s->streams[i], NULL);
+ return opts;
+}
+
+void *grow_array(void *array, int elem_size, int *size, int new_size)
+{
+ if (new_size >= INT_MAX / elem_size) {
+ av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
+ exit_program(1);
+ }
+ if (*size < new_size) {
+ uint8_t *tmp = av_realloc_array(array, new_size, elem_size);
+ if (!tmp) {
+ av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
+ exit_program(1);
+ }
+ memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
+ *size = new_size;
+ return tmp;
+ }
+ return array;
+}
+
+double get_rotation(AVStream *st)
+{
+ uint8_t* displaymatrix = av_stream_get_side_data(st,
+ AV_PKT_DATA_DISPLAYMATRIX, NULL);
+ double theta = 0;
+ if (displaymatrix)
+ theta = -av_display_rotation_get((int32_t*) displaymatrix);
+
+ theta -= 360*floor(theta/360 + 0.9/360);
+
+ if (fabs(theta - 90*round(theta/90)) > 2)
+ av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n"
+ "If you want to help, upload a sample "
+ "of this file to ftp://upload.ffmpeg.org/incoming/ "
+ "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)");
+
+ return theta;
+}
+
+#if CONFIG_AVDEVICE
+static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
+{
+ int ret, i;
+ AVDeviceInfoList *device_list = NULL;
+
+ if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
+ return AVERROR(EINVAL);
+
+ printf("Auto-detected sources for %s:\n", fmt->name);
+ if (!fmt->get_device_list) {
+ ret = AVERROR(ENOSYS);
+ printf("Cannot list sources. Not implemented.\n");
+ goto fail;
+ }
+
+ if ((ret = avdevice_list_input_sources(fmt, NULL, opts, &device_list)) < 0) {
+ printf("Cannot list sources.\n");
+ goto fail;
+ }
+
+ for (i = 0; i < device_list->nb_devices; i++) {
+ printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
+ device_list->devices[i]->device_name, device_list->devices[i]->device_description);
+ }
+
+ fail:
+ avdevice_free_list_devices(&device_list);
+ return ret;
+}
+
+static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
+{
+ int ret, i;
+ AVDeviceInfoList *device_list = NULL;
+
+ if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
+ return AVERROR(EINVAL);
+
+ printf("Auto-detected sinks for %s:\n", fmt->name);
+ if (!fmt->get_device_list) {
+ ret = AVERROR(ENOSYS);
+ printf("Cannot list sinks. Not implemented.\n");
+ goto fail;
+ }
+
+ if ((ret = avdevice_list_output_sinks(fmt, NULL, opts, &device_list)) < 0) {
+ printf("Cannot list sinks.\n");
+ goto fail;
+ }
+
+ for (i = 0; i < device_list->nb_devices; i++) {
+ printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
+ device_list->devices[i]->device_name, device_list->devices[i]->device_description);
+ }
+
+ fail:
+ avdevice_free_list_devices(&device_list);
+ return ret;
+}
+
+static int show_sinks_sources_parse_arg(const char *arg, char **dev, AVDictionary **opts)
+{
+ int ret;
+ if (arg) {
+ char *opts_str = NULL;
+ av_assert0(dev && opts);
+ *dev = av_strdup(arg);
+ if (!*dev)
+ return AVERROR(ENOMEM);
+ if ((opts_str = strchr(*dev, ','))) {
+ *(opts_str++) = '\0';
+ if (opts_str[0] && ((ret = av_dict_parse_string(opts, opts_str, "=", ":", 0)) < 0)) {
+ av_freep(dev);
+ return ret;
+ }
+ }
+ } else
+ printf("\nDevice name is not provided.\n"
+ "You can pass devicename[,opt1=val1[,opt2=val2...]] as an argument.\n\n");
+ return 0;
+}
+
+int show_sources(void *optctx, const char *opt, const char *arg)
+{
+ AVInputFormat *fmt = NULL;
+ char *dev = NULL;
+ AVDictionary *opts = NULL;
+ int ret = 0;
+ int error_level = av_log_get_level();
+
+ av_log_set_level(AV_LOG_ERROR);
+
+ if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
+ goto fail;
+
+ do {
+ fmt = av_input_audio_device_next(fmt);
+ if (fmt) {
+ if (!strcmp(fmt->name, "lavfi"))
+ continue; //it's pointless to probe lavfi
+ if (dev && !av_match_name(dev, fmt->name))
+ continue;
+ print_device_sources(fmt, opts);
+ }
+ } while (fmt);
+ do {
+ fmt = av_input_video_device_next(fmt);
+ if (fmt) {
+ if (dev && !av_match_name(dev, fmt->name))
+ continue;
+ print_device_sources(fmt, opts);
+ }
+ } while (fmt);
+ fail:
+ av_dict_free(&opts);
+ av_free(dev);
+ av_log_set_level(error_level);
+ return ret;
+}
+
+int show_sinks(void *optctx, const char *opt, const char *arg)
+{
+ AVOutputFormat *fmt = NULL;
+ char *dev = NULL;
+ AVDictionary *opts = NULL;
+ int ret = 0;
+ int error_level = av_log_get_level();
+
+ av_log_set_level(AV_LOG_ERROR);
+
+ if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
+ goto fail;
+
+ do {
+ fmt = av_output_audio_device_next(fmt);
+ if (fmt) {
+ if (dev && !av_match_name(dev, fmt->name))
+ continue;
+ print_device_sinks(fmt, opts);
+ }
+ } while (fmt);
+ do {
+ fmt = av_output_video_device_next(fmt);
+ if (fmt) {
+ if (dev && !av_match_name(dev, fmt->name))
+ continue;
+ print_device_sinks(fmt, opts);
+ }
+ } while (fmt);
+ fail:
+ av_dict_free(&opts);
+ av_free(dev);
+ av_log_set_level(error_level);
+ return ret;
+}
+
+#endif
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils.h b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils.h
new file mode 100644
index 00000000..e75d8d31
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils.h
@@ -0,0 +1,609 @@
+/*
+ * Various utilities for command line tools
+ * copyright (c) 2003 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef CMDUTILS_H
+#define CMDUTILS_H
+
+#include
+
+#include "config.h"
+#include "libavcodec/avcodec.h"
+#include "libavfilter/avfilter.h"
+#include "libavformat/avformat.h"
+#include "libswscale/swscale.h"
+
+#ifdef _WIN32
+#undef main /* We don't want SDL to override our main() */
+#endif
+
+/**
+ * program name, defined by the program for show_version().
+ */
+extern const char program_name[];
+
+/**
+ * program birth year, defined by the program for show_banner()
+ */
+extern const int program_birth_year;
+
+extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
+extern AVFormatContext *avformat_opts;
+extern AVDictionary *sws_dict;
+extern AVDictionary *swr_opts;
+extern AVDictionary *format_opts, *codec_opts, *resample_opts;
+extern int hide_banner;
+
+/**
+ * Register a program-specific cleanup routine.
+ */
+void register_exit(void (*cb)(int ret));
+
+/**
+ * Wraps exit with a program-specific cleanup routine.
+ */
+void exit_program(int ret) av_noreturn;
+
+/**
+ * Initialize dynamic library loading
+ */
+void init_dynload(void);
+
+/**
+ * Initialize the cmdutils option system, in particular
+ * allocate the *_opts contexts.
+ */
+void init_opts(void);
+/**
+ * Uninitialize the cmdutils option system, in particular
+ * free the *_opts contexts and their contents.
+ */
+void uninit_opts(void);
+
+/**
+ * Trivial log callback.
+ * Only suitable for opt_help and similar since it lacks prefix handling.
+ */
+void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
+
+/**
+ * Override the cpuflags.
+ */
+int opt_cpuflags(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Fallback for options that are not explicitly handled, these will be
+ * parsed through AVOptions.
+ */
+int opt_default(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Set the libav* libraries log level.
+ */
+int opt_loglevel(void *optctx, const char *opt, const char *arg);
+
+int opt_report(const char *opt);
+
+int opt_max_alloc(void *optctx, const char *opt, const char *arg);
+
+int opt_codec_debug(void *optctx, const char *opt, const char *arg);
+
+#if CONFIG_OPENCL
+int opt_opencl(void *optctx, const char *opt, const char *arg);
+
+int opt_opencl_bench(void *optctx, const char *opt, const char *arg);
+#endif
+
+/**
+ * Limit the execution time.
+ */
+int opt_timelimit(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Parse a string and return its corresponding value as a double.
+ * Exit from the application if the string cannot be correctly
+ * parsed or the corresponding value is invalid.
+ *
+ * @param context the context of the value to be set (e.g. the
+ * corresponding command line option name)
+ * @param numstr the string to be parsed
+ * @param type the type (OPT_INT64 or OPT_FLOAT) as which the
+ * string should be parsed
+ * @param min the minimum valid accepted value
+ * @param max the maximum valid accepted value
+ */
+double parse_number_or_die(const char *context, const char *numstr, int type,
+ double min, double max);
+
+/**
+ * Parse a string specifying a time and return its corresponding
+ * value as a number of microseconds. Exit from the application if
+ * the string cannot be correctly parsed.
+ *
+ * @param context the context of the value to be set (e.g. the
+ * corresponding command line option name)
+ * @param timestr the string to be parsed
+ * @param is_duration a flag which tells how to interpret timestr, if
+ * not zero timestr is interpreted as a duration, otherwise as a
+ * date
+ *
+ * @see av_parse_time()
+ */
+int64_t parse_time_or_die(const char *context, const char *timestr,
+ int is_duration);
+
+typedef struct SpecifierOpt {
+ char *specifier; /**< stream/chapter/program/... specifier */
+ union {
+ uint8_t *str;
+ int i;
+ int64_t i64;
+ float f;
+ double dbl;
+ } u;
+} SpecifierOpt;
+
+typedef struct OptionDef {
+ const char *name;
+ int flags;
+#define HAS_ARG 0x0001
+#define OPT_BOOL 0x0002
+#define OPT_EXPERT 0x0004
+#define OPT_STRING 0x0008
+#define OPT_VIDEO 0x0010
+#define OPT_AUDIO 0x0020
+#define OPT_INT 0x0080
+#define OPT_FLOAT 0x0100
+#define OPT_SUBTITLE 0x0200
+#define OPT_INT64 0x0400
+#define OPT_EXIT 0x0800
+#define OPT_DATA 0x1000
+#define OPT_PERFILE 0x2000 /* the option is per-file (currently ffmpeg-only).
+ implied by OPT_OFFSET or OPT_SPEC */
+#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */
+#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt.
+ Implies OPT_OFFSET. Next element after the offset is
+ an int containing element count in the array. */
+#define OPT_TIME 0x10000
+#define OPT_DOUBLE 0x20000
+#define OPT_INPUT 0x40000
+#define OPT_OUTPUT 0x80000
+ union {
+ void *dst_ptr;
+ int (*func_arg)(void *, const char *, const char *);
+ size_t off;
+ } u;
+ const char *help;
+ const char *argname;
+} OptionDef;
+
+/**
+ * Print help for all options matching specified flags.
+ *
+ * @param options a list of options
+ * @param msg title of this group. Only printed if at least one option matches.
+ * @param req_flags print only options which have all those flags set.
+ * @param rej_flags don't print options which have any of those flags set.
+ * @param alt_flags print only options that have at least one of those flags set
+ */
+void show_help_options(const OptionDef *options, const char *msg, int req_flags,
+ int rej_flags, int alt_flags);
+
+/**
+ * Show help for all options with given flags in class and all its
+ * children.
+ */
+void show_help_children(const AVClass *class, int flags);
+
+/**
+ * Per-fftool specific help handler. Implemented in each
+ * fftool, called by show_help().
+ */
+void show_help_default(const char *opt, const char *arg);
+
+/**
+ * Generic -h handler common to all fftools.
+ */
+int show_help(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Parse the command line arguments.
+ *
+ * @param optctx an opaque options context
+ * @param argc number of command line arguments
+ * @param argv values of command line arguments
+ * @param options Array with the definitions required to interpret every
+ * option of the form: -option_name [argument]
+ * @param parse_arg_function Name of the function called to process every
+ * argument without a leading option name flag. NULL if such arguments do
+ * not have to be processed.
+ */
+void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
+ void (* parse_arg_function)(void *optctx, const char*));
+
+/**
+ * Parse one given option.
+ *
+ * @return on success 1 if arg was consumed, 0 otherwise; negative number on error
+ */
+int parse_option(void *optctx, const char *opt, const char *arg,
+ const OptionDef *options);
+
+/**
+ * An option extracted from the commandline.
+ * Cannot use AVDictionary because of options like -map which can be
+ * used multiple times.
+ */
+typedef struct Option {
+ const OptionDef *opt;
+ const char *key;
+ const char *val;
+} Option;
+
+typedef struct OptionGroupDef {
+ /**< group name */
+ const char *name;
+ /**
+ * Option to be used as group separator. Can be NULL for groups which
+ * are terminated by a non-option argument (e.g. ffmpeg output files)
+ */
+ const char *sep;
+ /**
+ * Option flags that must be set on each option that is
+ * applied to this group
+ */
+ int flags;
+} OptionGroupDef;
+
+typedef struct OptionGroup {
+ const OptionGroupDef *group_def;
+ const char *arg;
+
+ Option *opts;
+ int nb_opts;
+
+ AVDictionary *codec_opts;
+ AVDictionary *format_opts;
+ AVDictionary *resample_opts;
+ AVDictionary *sws_dict;
+ AVDictionary *swr_opts;
+} OptionGroup;
+
+/**
+ * A list of option groups that all have the same group type
+ * (e.g. input files or output files)
+ */
+typedef struct OptionGroupList {
+ const OptionGroupDef *group_def;
+
+ OptionGroup *groups;
+ int nb_groups;
+} OptionGroupList;
+
+typedef struct OptionParseContext {
+ OptionGroup global_opts;
+
+ OptionGroupList *groups;
+ int nb_groups;
+
+ /* parsing state */
+ OptionGroup cur_group;
+} OptionParseContext;
+
+/**
+ * Parse an options group and write results into optctx.
+ *
+ * @param optctx an app-specific options context. NULL for global options group
+ */
+int parse_optgroup(void *optctx, OptionGroup *g);
+
+/**
+ * Split the commandline into an intermediate form convenient for further
+ * processing.
+ *
+ * The commandline is assumed to be composed of options which either belong to a
+ * group (those with OPT_SPEC, OPT_OFFSET or OPT_PERFILE) or are global
+ * (everything else).
+ *
+ * A group (defined by an OptionGroupDef struct) is a sequence of options
+ * terminated by either a group separator option (e.g. -i) or a parameter that
+ * is not an option (doesn't start with -). A group without a separator option
+ * must always be first in the supplied groups list.
+ *
+ * All options within the same group are stored in one OptionGroup struct in an
+ * OptionGroupList, all groups with the same group definition are stored in one
+ * OptionGroupList in OptionParseContext.groups. The order of group lists is the
+ * same as the order of group definitions.
+ */
+int split_commandline(OptionParseContext *octx, int argc, char *argv[],
+ const OptionDef *options,
+ const OptionGroupDef *groups, int nb_groups);
+
+/**
+ * Free all allocated memory in an OptionParseContext.
+ */
+void uninit_parse_context(OptionParseContext *octx);
+
+/**
+ * Find the '-loglevel' option in the command line args and apply it.
+ */
+void parse_loglevel(int argc, char **argv, const OptionDef *options);
+
+/**
+ * Return index of option opt in argv or 0 if not found.
+ */
+int locate_option(int argc, char **argv, const OptionDef *options,
+ const char *optname);
+
+/**
+ * Check if the given stream matches a stream specifier.
+ *
+ * @param s Corresponding format context.
+ * @param st Stream from s to be checked.
+ * @param spec A stream specifier of the [v|a|s|d]:[\] form.
+ *
+ * @return 1 if the stream matches, 0 if it doesn't, <0 on error
+ */
+int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
+
+/**
+ * Filter out options for given codec.
+ *
+ * Create a new options dictionary containing only the options from
+ * opts which apply to the codec with ID codec_id.
+ *
+ * @param opts dictionary to place options in
+ * @param codec_id ID of the codec that should be filtered for
+ * @param s Corresponding format context.
+ * @param st A stream from s for which the options should be filtered.
+ * @param codec The particular codec for which the options should be filtered.
+ * If null, the default one is looked up according to the codec id.
+ * @return a pointer to the created dictionary
+ */
+AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
+ AVFormatContext *s, AVStream *st, AVCodec *codec);
+
+/**
+ * Setup AVCodecContext options for avformat_find_stream_info().
+ *
+ * Create an array of dictionaries, one dictionary for each stream
+ * contained in s.
+ * Each dictionary will contain the options from codec_opts which can
+ * be applied to the corresponding stream codec context.
+ *
+ * @return pointer to the created array of dictionaries, NULL if it
+ * cannot be created
+ */
+AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
+ AVDictionary *codec_opts);
+
+/**
+ * Print an error message to stderr, indicating filename and a human
+ * readable description of the error code err.
+ *
+ * If strerror_r() is not available the use of this function in a
+ * multithreaded application may be unsafe.
+ *
+ * @see av_strerror()
+ */
+void print_error(const char *filename, int err);
+
+/**
+ * Print the program banner to stderr. The banner contents depend on the
+ * current version of the repository and of the libav* libraries used by
+ * the program.
+ */
+void show_banner(int argc, char **argv, const OptionDef *options);
+
+/**
+ * Print the version of the program to stdout. The version message
+ * depends on the current versions of the repository and of the libav*
+ * libraries.
+ * This option processing function does not utilize the arguments.
+ */
+int show_version(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print the build configuration of the program to stdout. The contents
+ * depend on the definition of FFMPEG_CONFIGURATION.
+ * This option processing function does not utilize the arguments.
+ */
+int show_buildconf(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print the license of the program to stdout. The license depends on
+ * the license of the libraries compiled into the program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_license(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the formats supported by the
+ * program (including devices).
+ * This option processing function does not utilize the arguments.
+ */
+int show_formats(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the muxers supported by the
+ * program (including devices).
+ * This option processing function does not utilize the arguments.
+ */
+int show_muxers(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the demuxer supported by the
+ * program (including devices).
+ * This option processing function does not utilize the arguments.
+ */
+int show_demuxers(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the devices supported by the
+ * program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_devices(void *optctx, const char *opt, const char *arg);
+
+#if CONFIG_AVDEVICE
+/**
+ * Print a listing containing autodetected sinks of the output device.
+ * Device name with options may be passed as an argument to limit results.
+ */
+int show_sinks(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing autodetected sources of the input device.
+ * Device name with options may be passed as an argument to limit results.
+ */
+int show_sources(void *optctx, const char *opt, const char *arg);
+#endif
+
+/**
+ * Print a listing containing all the codecs supported by the
+ * program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_codecs(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the decoders supported by the
+ * program.
+ */
+int show_decoders(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the encoders supported by the
+ * program.
+ */
+int show_encoders(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the filters supported by the
+ * program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_filters(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the bit stream filters supported by the
+ * program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_bsfs(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the protocols supported by the
+ * program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_protocols(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the pixel formats supported by the
+ * program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_pix_fmts(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the standard channel layouts supported by
+ * the program.
+ * This option processing function does not utilize the arguments.
+ */
+int show_layouts(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the sample formats supported by the
+ * program.
+ */
+int show_sample_fmts(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Print a listing containing all the color names and values recognized
+ * by the program.
+ */
+int show_colors(void *optctx, const char *opt, const char *arg);
+
+/**
+ * Return a positive value if a line read from standard input
+ * starts with [yY], otherwise return 0.
+ */
+int read_yesno(void);
+
+/**
+ * Get a file corresponding to a preset file.
+ *
+ * If is_path is non-zero, look for the file in the path preset_name.
+ * Otherwise search for a file named arg.ffpreset in the directories
+ * $FFMPEG_DATADIR (if set), $HOME/.ffmpeg, and in the datadir defined
+ * at configuration time or in a "ffpresets" folder along the executable
+ * on win32, in that order. If no such file is found and
+ * codec_name is defined, then search for a file named
+ * codec_name-preset_name.avpreset in the above-mentioned directories.
+ *
+ * @param filename buffer where the name of the found filename is written
+ * @param filename_size size in bytes of the filename buffer
+ * @param preset_name name of the preset to search
+ * @param is_path tell if preset_name is a filename path
+ * @param codec_name name of the codec for which to look for the
+ * preset, may be NULL
+ */
+FILE *get_preset_file(char *filename, size_t filename_size,
+ const char *preset_name, int is_path, const char *codec_name);
+
+/**
+ * Realloc array to hold new_size elements of elem_size.
+ * Calls exit() on failure.
+ *
+ * @param array array to reallocate
+ * @param elem_size size in bytes of each element
+ * @param size new element count will be written here
+ * @param new_size number of elements to place in reallocated array
+ * @return reallocated array
+ */
+void *grow_array(void *array, int elem_size, int *size, int new_size);
+
+#define media_type_string av_get_media_type_string
+
+#define GROW_ARRAY(array, nb_elems)\
+ array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
+
+#define GET_PIX_FMT_NAME(pix_fmt)\
+ const char *name = av_get_pix_fmt_name(pix_fmt);
+
+#define GET_SAMPLE_FMT_NAME(sample_fmt)\
+ const char *name = av_get_sample_fmt_name(sample_fmt)
+
+#define GET_SAMPLE_RATE_NAME(rate)\
+ char name[16];\
+ snprintf(name, sizeof(name), "%d", rate);
+
+#define GET_CH_LAYOUT_NAME(ch_layout)\
+ char name[16];\
+ snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout);
+
+#define GET_CH_LAYOUT_DESC(ch_layout)\
+ char name[128];\
+ av_get_channel_layout_string(name, sizeof(name), 0, ch_layout);
+
+double get_rotation(AVStream *st);
+
+#endif /* CMDUTILS_H */
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils_common_opts.h b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils_common_opts.h
new file mode 100644
index 00000000..f7c1ca4d
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/cmdutils_common_opts.h
@@ -0,0 +1,37 @@
+ { "L" , OPT_EXIT, {.func_arg = show_license}, "show license" },
+ { "h" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
+ { "?" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
+ { "help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
+ { "-help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
+ { "version" , OPT_EXIT, {.func_arg = show_version}, "show version" },
+ { "buildconf" , OPT_EXIT, {.func_arg = show_buildconf}, "show build configuration" },
+ { "formats" , OPT_EXIT, {.func_arg = show_formats }, "show available formats" },
+ { "muxers" , OPT_EXIT, {.func_arg = show_muxers }, "show available muxers" },
+ { "demuxers" , OPT_EXIT, {.func_arg = show_demuxers }, "show available demuxers" },
+ { "devices" , OPT_EXIT, {.func_arg = show_devices }, "show available devices" },
+ { "codecs" , OPT_EXIT, {.func_arg = show_codecs }, "show available codecs" },
+ { "decoders" , OPT_EXIT, {.func_arg = show_decoders }, "show available decoders" },
+ { "encoders" , OPT_EXIT, {.func_arg = show_encoders }, "show available encoders" },
+ { "bsfs" , OPT_EXIT, {.func_arg = show_bsfs }, "show available bit stream filters" },
+ { "protocols" , OPT_EXIT, {.func_arg = show_protocols}, "show available protocols" },
+ { "filters" , OPT_EXIT, {.func_arg = show_filters }, "show available filters" },
+ { "pix_fmts" , OPT_EXIT, {.func_arg = show_pix_fmts }, "show available pixel formats" },
+ { "layouts" , OPT_EXIT, {.func_arg = show_layouts }, "show standard channel layouts" },
+ { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
+ { "colors" , OPT_EXIT, {.func_arg = show_colors }, "show available color names" },
+ { "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" },
+ { "v", HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" },
+ { "report" , 0, {(void*)opt_report}, "generate a report" },
+ { "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
+ { "cpuflags" , HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" },
+ { "hide_banner", OPT_BOOL | OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" },
+#if CONFIG_OPENCL
+ { "opencl_bench", OPT_EXIT, {.func_arg = opt_opencl_bench}, "run benchmark on all OpenCL devices and show results" },
+ { "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" },
+#endif
+#if CONFIG_AVDEVICE
+ { "sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_sources },
+ "list sources of the input device", "device" },
+ { "sinks" , OPT_EXIT | HAS_ARG, { .func_arg = show_sinks },
+ "list sinks of the output device", "device" },
+#endif
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/com_sherry_ffmpegdemo_FfmpegKit.h b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/com_sherry_ffmpegdemo_FfmpegKit.h
new file mode 100644
index 00000000..7a8bd7d8
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/com_sherry_ffmpegdemo_FfmpegKit.h
@@ -0,0 +1,29 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include
+/* Header for class com_sherry_ffmpegdemo_FfmpegKit */
+
+#ifndef _Included_com_sherry_ffmpegdemo_FfmpegKit
+#define _Included_com_sherry_ffmpegdemo_FfmpegKit
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: com_sherry_ffmpegdemo_FfmpegKit
+ * Method: run
+ * Signature: ([Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_com_sherry_ffmpegdemo_FfmpegKit_run
+ (JNIEnv *, jclass, jobjectArray);
+
+/*
+ * Class: com_sherry_ffmpegdemo_FfmpegKit
+ * Method: configure
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_sherry_ffmpegdemo_FfmpegKit_configure
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/com_sherry_ffmpegdemo_FfmpegKit_OnExecListener.h b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/com_sherry_ffmpegdemo_FfmpegKit_OnExecListener.h
new file mode 100644
index 00000000..8c8b1345
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/com_sherry_ffmpegdemo_FfmpegKit_OnExecListener.h
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include
+/* Header for class com_sherry_ffmpegdemo_FfmpegKit_OnExecListener */
+
+#ifndef _Included_com_sherry_ffmpegdemo_FfmpegKit_OnExecListener
+#define _Included_com_sherry_ffmpegdemo_FfmpegKit_OnExecListener
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/config.h b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/config.h
new file mode 100644
index 00000000..6f9420af
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/config.h
@@ -0,0 +1,2269 @@
+/* Automatically generated by configure - do not modify! */
+#ifndef FFMPEG_CONFIG_H
+#define FFMPEG_CONFIG_H
+#define FFMPEG_CONFIGURATION "--prefix='E:/ffmpeg2/output/arm' --enable-asm --enable-neon --enable-shared --enable-small --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-symver --disable-muxers --enable-muxer=mov --enable-muxer=mp4 --enable-muxer=avi --disable-decoders --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mpeg4 --disable-demuxers --enable-demuxer=h264 --enable-demuxer=avi --disable-parsers --enable-parser=aac --enable-parser=h264 --cross-prefix='D:/Android/sdk/ndk-bundle/toolchains/arm-Linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-' --target-os=linux --arch=arm --cpu=armv7-a --enable-cross-compile --sysroot='D:/Android/sdk/ndk-bundle/platforms/Android-14/arch-arm' --extra-cflags='-fPIC -DANDROID -mfpu=neon -mfloat-abi=softfp -ID:/Android/sdk/ndk-bundle/platforms/android-19/arch-arm/usr/include' --extra-ldflags="
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2017
+#define FFMPEG_DATADIR "E:/ffmpeg2/output/arm/share/ffmpeg"
+#define AVCONV_DATADIR "E:/ffmpeg2/output/arm/share/ffmpeg"
+#define CC_IDENT "gcc 4.9.x (GCC) 20150123 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 1
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 1
+#define HAVE_ARMV6 1
+#define HAVE_ARMV6T2 1
+#define HAVE_ARMV8 0
+#define HAVE_NEON 1
+#define HAVE_VFP 1
+#define HAVE_VFPV3 1
+#define HAVE_SETEND 1
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AESNI 0
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
+#define HAVE_FMA4 0
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R2 0
+#define HAVE_MIPS32R6 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSP 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
+#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 1
+#define HAVE_ARMV6_EXTERNAL 1
+#define HAVE_ARMV6T2_EXTERNAL 1
+#define HAVE_ARMV8_EXTERNAL 0
+#define HAVE_NEON_EXTERNAL 1
+#define HAVE_VFP_EXTERNAL 1
+#define HAVE_VFPV3_EXTERNAL 1
+#define HAVE_SETEND_EXTERNAL 1
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AESNI_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R2_EXTERNAL 0
+#define HAVE_MIPS32R6_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSP_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 1
+#define HAVE_ARMV6_INLINE 1
+#define HAVE_ARMV6T2_INLINE 1
+#define HAVE_ARMV8_INLINE 0
+#define HAVE_NEON_INLINE 1
+#define HAVE_VFP_INLINE 1
+#define HAVE_VFPV3_INLINE 1
+#define HAVE_SETEND_INLINE 1
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AESNI_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 0
+#define HAVE_AMD3DNOWEXT_INLINE 0
+#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
+#define HAVE_FMA4_INLINE 0
+#define HAVE_MMX_INLINE 0
+#define HAVE_MMXEXT_INLINE 0
+#define HAVE_SSE_INLINE 0
+#define HAVE_SSE2_INLINE 0
+#define HAVE_SSE3_INLINE 0
+#define HAVE_SSE4_INLINE 0
+#define HAVE_SSE42_INLINE 0
+#define HAVE_SSSE3_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R2_INLINE 0
+#define HAVE_MIPS32R6_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSP_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_SIMD_ALIGN_16 1
+#define HAVE_SIMD_ALIGN_32 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SEM_TIMEDWAIT 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_CABS 0
+#define HAVE_CEXP 0
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 0
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 1
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_CUDA_H 0
+#define HAVE_DISPATCH_DISPATCH_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENCV2_CORE_CORE_C_H 0
+#define HAVE_OPENJPEG_2_1_OPENJPEG_H 0
+#define HAVE_OPENJPEG_2_0_OPENJPEG_H 0
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_STDATOMIC_H 1
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 1
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_HYPOT 1
+#define HAVE_ISFINITE 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 0
+#define HAVE_LOG2F 0
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_ARC4RANDOM 1
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 1
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOADLIBRARY 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 0
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 1
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_UTGETOSTYPEFROMSTRING 0
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 1
+#define HAVE_AS_FPU_DIRECTIVE 1
+#define HAVE_AS_FUNC 1
+#define HAVE_AS_OBJECT_ARCH 1
+#define HAVE_ASM_MOD_Q 1
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 1
+#define HAVE_STRUCT_ADDRINFO 1
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 1
+#define HAVE_STRUCT_IP_MREQ_SOURCE 1
+#define HAVE_STRUCT_IPV6_MREQ 1
+#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 1
+#define HAVE_STRUCT_POLLFD 1
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 1
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL2 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_DRM 0
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_WINRT 0
+#define HAVE_XLIB 1
+#define CONFIG_BSFS 1
+#define CONFIG_DECODERS 1
+#define CONFIG_ENCODERS 1
+#define CONFIG_HWACCELS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_INDEVS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_FILTERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_MUXERS 1
+#define CONFIG_PROTOCOLS 1
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 1
+#define CONFIG_PODPAGES 1
+#define CONFIG_TXTPAGES 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_DECODE_AUDIO_EXAMPLE 1
+#define CONFIG_DECODE_VIDEO_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_ENCODE_AUDIO_EXAMPLE 1
+#define CONFIG_ENCODE_VIDEO_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 1
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 1
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 1
+#define CONFIG_HTTP_MULTICLIENT_EXAMPLE 1
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 1
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 1
+#define CONFIG_SCALING_VIDEO_EXAMPLE 1
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 1
+#define CONFIG_TRANSCODING_EXAMPLE 1
+#define CONFIG_BZLIB 0
+#define CONFIG_ICONV 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LZMA 0
+#define CONFIG_SCHANNEL 0
+#define CONFIG_SDL 0
+#define CONFIG_SDL2 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_XLIB 1
+#define CONFIG_ZLIB 1
+#define CONFIG_AVISYNTH 0
+#define CONFIG_FREI0R 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBRUBBERBAND 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBX264 1
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_GMP 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_CHROMAPRINT 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_JNI 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPENMPT 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBZIMG 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_MEDIACODEC 0
+#define CONFIG_NETCDF 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_AUDIOTOOLBOX 0
+#define CONFIG_CUDA 0
+#define CONFIG_CUVID 0
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_NVENC 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_XVMC 0
+#define CONFIG_LIBNPP 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_MMAL 0
+#define CONFIG_OMX 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_OMX_RPI 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 1
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 0
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 1
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 1
+#define CONFIG_SWSCALE 1
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 0
+#define CONFIG_DWT 1
+#define CONFIG_ERROR_RESILIENCE 1
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 1
+#define CONFIG_NETWORK 1
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 1
+#define CONFIG_AC3DSP 1
+#define CONFIG_AUDIO_FRAME_QUEUE 1
+#define CONFIG_AUDIODSP 1
+#define CONFIG_BLOCKDSP 1
+#define CONFIG_BSWAPDSP 1
+#define CONFIG_CABAC 1
+#define CONFIG_DIRAC_PARSE 0
+#define CONFIG_DVPROFILE 1
+#define CONFIG_EXIF 1
+#define CONFIG_FAANDCT 1
+#define CONFIG_FAANIDCT 1
+#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 1
+#define CONFIG_G722DSP 1
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 1
+#define CONFIG_H264CHROMA 1
+#define CONFIG_H264DSP 1
+#define CONFIG_H264PARSE 1
+#define CONFIG_H264PRED 1
+#define CONFIG_H264QPEL 1
+#define CONFIG_HPELDSP 1
+#define CONFIG_HUFFMAN 1
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 1
+#define CONFIG_IDCTDSP 1
+#define CONFIG_IIRFILTER 1
+#define CONFIG_MDCT15 1
+#define CONFIG_INTRAX8 0
+#define CONFIG_ISO_MEDIA 1
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 1
+#define CONFIG_LGPLV3 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LLVIDENCDSP 1
+#define CONFIG_LPC 1
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 1
+#define CONFIG_MPEG_ER 1
+#define CONFIG_MPEGAUDIO 0
+#define CONFIG_MPEGAUDIODSP 0
+#define CONFIG_MPEGVIDEO 1
+#define CONFIG_MPEGVIDEOENC 1
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 1
+#define CONFIG_QPELDSP 1
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 1
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 1
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 1
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
+#define CONFIG_SRTP 1
+#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VAAPI_ENCODE 0
+#define CONFIG_VC1DSP 0
+#define CONFIG_VIDEODSP 1
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_VT_BT2020 0
+#define CONFIG_WMA_FREQS 1
+#define CONFIG_WMV2DSP 1
+#define CONFIG_AAC_ADTSTOASC_BSF 1
+#define CONFIG_CHOMP_BSF 1
+#define CONFIG_DUMP_EXTRADATA_BSF 1
+#define CONFIG_DCA_CORE_BSF 1
+#define CONFIG_EXTRACT_EXTRADATA_BSF 1
+#define CONFIG_H264_MP4TOANNEXB_BSF 1
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 1
+#define CONFIG_IMX_DUMP_HEADER_BSF 1
+#define CONFIG_MJPEG2JPEG_BSF 1
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 1
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1
+#define CONFIG_MOV2TEXTSUB_BSF 1
+#define CONFIG_NOISE_BSF 1
+#define CONFIG_REMOVE_EXTRADATA_BSF 1
+#define CONFIG_TEXT2MOVSUB_BSF 1
+#define CONFIG_VP9_SUPERFRAME_BSF 1
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CFHD_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLEARVIDEO_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVAUDIO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FMVC_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 1
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 1
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MEDIACODEC_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_M101_DECODER 0
+#define CONFIG_MAGICYUV_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 1
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_MMAL_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_MMAL_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PIXLET_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PSD_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RSCC_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SCPR_DECODER 0
+#define CONFIG_SCREENPRESSO_DECODER 0
+#define CONFIG_SDX2_DPCM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SHEERVIDEO_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SPEEDHQ_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TRUEMOTION2RT_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_MMAL_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XPM_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YLC_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3AL_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_ATRAC3PAL_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_DST_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_INTERPLAY_ACM_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 0
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_QDMC_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 0
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_XMA1_DECODER 0
+#define CONFIG_XMA2_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 0
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F16LE_DECODER 0
+#define CONFIG_PCM_F24LE_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 0
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 0
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 0
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 0
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 0
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 0
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S64BE_DECODER 0
+#define CONFIG_PCM_S64LE_DECODER 0
+#define CONFIG_PCM_U8_DECODER 0
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_AICA_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DAT4_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_MTAF_DECODER 0
+#define CONFIG_ADPCM_PSX_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_AAC_AT_DECODER 0
+#define CONFIG_AC3_AT_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_AT_DECODER 0
+#define CONFIG_ALAC_AT_DECODER 0
+#define CONFIG_AMR_NB_AT_DECODER 0
+#define CONFIG_EAC3_AT_DECODER 0
+#define CONFIG_GSM_MS_AT_DECODER 0
+#define CONFIG_ILBC_AT_DECODER 0
+#define CONFIG_MP1_AT_DECODER 0
+#define CONFIG_MP2_AT_DECODER 0
+#define CONFIG_MP3_AT_DECODER 0
+#define CONFIG_PCM_ALAW_AT_DECODER 0
+#define CONFIG_PCM_MULAW_AT_DECODER 0
+#define CONFIG_QDMC_AT_DECODER 0
+#define CONFIG_QDM2_AT_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_LIBOPENH264_DECODER 0
+#define CONFIG_H264_CUVID_DECODER 0
+#define CONFIG_HEVC_CUVID_DECODER 0
+#define CONFIG_HEVC_MEDIACODEC_DECODER 0
+#define CONFIG_MJPEG_CUVID_DECODER 0
+#define CONFIG_MPEG1_CUVID_DECODER 0
+#define CONFIG_MPEG2_CUVID_DECODER 0
+#define CONFIG_MPEG4_CUVID_DECODER 0
+#define CONFIG_MPEG4_MEDIACODEC_DECODER 0
+#define CONFIG_VC1_CUVID_DECODER 0
+#define CONFIG_VP8_CUVID_DECODER 0
+#define CONFIG_VP8_MEDIACODEC_DECODER 0
+#define CONFIG_VP8_QSV_DECODER 0
+#define CONFIG_VP9_CUVID_DECODER 0
+#define CONFIG_VP9_MEDIACODEC_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACM_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADS_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AIX_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 1
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DCSTR_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DVBTXT_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_FSB_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GENH_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 1
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_IVR_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 0
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MJPEG_2000_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 0
+#define CONFIG_MP3_DEMUXER 0
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSF_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTAF_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MUSX_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 0
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SCC_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SDS_DEMUXER 0
+#define CONFIG_SDX_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SVAG_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_THREEDOSTR_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_V210_DEMUXER 0
+#define CONFIG_V210X_DEMUXER 0
+#define CONFIG_VAG_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPK_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 0
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WVE_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XVAG_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PAM_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PBM_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PCX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PGM_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PPM_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PSD_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_XPM_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBOPENMPT_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 1
+#define CONFIG_A64MULTI5_ENCODER 1
+#define CONFIG_ALIAS_PIX_ENCODER 1
+#define CONFIG_AMV_ENCODER 1
+#define CONFIG_APNG_ENCODER 1
+#define CONFIG_ASV1_ENCODER 1
+#define CONFIG_ASV2_ENCODER 1
+#define CONFIG_AVRP_ENCODER 1
+#define CONFIG_AVUI_ENCODER 1
+#define CONFIG_AYUV_ENCODER 1
+#define CONFIG_BMP_ENCODER 1
+#define CONFIG_CINEPAK_ENCODER 1
+#define CONFIG_CLJR_ENCODER 1
+#define CONFIG_COMFORTNOISE_ENCODER 1
+#define CONFIG_DNXHD_ENCODER 1
+#define CONFIG_DPX_ENCODER 1
+#define CONFIG_DVVIDEO_ENCODER 1
+#define CONFIG_FFV1_ENCODER 1
+#define CONFIG_FFVHUFF_ENCODER 1
+#define CONFIG_FLASHSV_ENCODER 1
+#define CONFIG_FLASHSV2_ENCODER 1
+#define CONFIG_FLV_ENCODER 1
+#define CONFIG_GIF_ENCODER 1
+#define CONFIG_H261_ENCODER 1
+#define CONFIG_H263_ENCODER 1
+#define CONFIG_H263P_ENCODER 1
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 1
+#define CONFIG_JPEG2000_ENCODER 1
+#define CONFIG_JPEGLS_ENCODER 1
+#define CONFIG_LJPEG_ENCODER 1
+#define CONFIG_MJPEG_ENCODER 1
+#define CONFIG_MPEG1VIDEO_ENCODER 1
+#define CONFIG_MPEG2VIDEO_ENCODER 1
+#define CONFIG_MPEG4_ENCODER 1
+#define CONFIG_MSMPEG4V2_ENCODER 1
+#define CONFIG_MSMPEG4V3_ENCODER 1
+#define CONFIG_MSVIDEO1_ENCODER 1
+#define CONFIG_PAM_ENCODER 1
+#define CONFIG_PBM_ENCODER 1
+#define CONFIG_PCX_ENCODER 1
+#define CONFIG_PGM_ENCODER 1
+#define CONFIG_PGMYUV_ENCODER 1
+#define CONFIG_PNG_ENCODER 1
+#define CONFIG_PPM_ENCODER 1
+#define CONFIG_PRORES_ENCODER 1
+#define CONFIG_PRORES_AW_ENCODER 1
+#define CONFIG_PRORES_KS_ENCODER 1
+#define CONFIG_QTRLE_ENCODER 1
+#define CONFIG_R10K_ENCODER 1
+#define CONFIG_R210_ENCODER 1
+#define CONFIG_RAWVIDEO_ENCODER 1
+#define CONFIG_ROQ_ENCODER 1
+#define CONFIG_RV10_ENCODER 1
+#define CONFIG_RV20_ENCODER 1
+#define CONFIG_S302M_ENCODER 1
+#define CONFIG_SGI_ENCODER 1
+#define CONFIG_SNOW_ENCODER 1
+#define CONFIG_SUNRAST_ENCODER 1
+#define CONFIG_SVQ1_ENCODER 1
+#define CONFIG_TARGA_ENCODER 1
+#define CONFIG_TIFF_ENCODER 1
+#define CONFIG_UTVIDEO_ENCODER 1
+#define CONFIG_V210_ENCODER 1
+#define CONFIG_V308_ENCODER 1
+#define CONFIG_V408_ENCODER 1
+#define CONFIG_V410_ENCODER 1
+#define CONFIG_VC2_ENCODER 1
+#define CONFIG_WRAPPED_AVFRAME_ENCODER 1
+#define CONFIG_WMV1_ENCODER 1
+#define CONFIG_WMV2_ENCODER 1
+#define CONFIG_XBM_ENCODER 1
+#define CONFIG_XFACE_ENCODER 1
+#define CONFIG_XWD_ENCODER 1
+#define CONFIG_Y41P_ENCODER 1
+#define CONFIG_YUV4_ENCODER 1
+#define CONFIG_ZLIB_ENCODER 1
+#define CONFIG_ZMBV_ENCODER 1
+#define CONFIG_AAC_ENCODER 1
+#define CONFIG_AC3_ENCODER 1
+#define CONFIG_AC3_FIXED_ENCODER 1
+#define CONFIG_ALAC_ENCODER 1
+#define CONFIG_DCA_ENCODER 1
+#define CONFIG_EAC3_ENCODER 1
+#define CONFIG_FLAC_ENCODER 1
+#define CONFIG_G723_1_ENCODER 1
+#define CONFIG_MLP_ENCODER 1
+#define CONFIG_MP2_ENCODER 1
+#define CONFIG_MP2FIXED_ENCODER 1
+#define CONFIG_NELLYMOSER_ENCODER 1
+#define CONFIG_OPUS_ENCODER 1
+#define CONFIG_RA_144_ENCODER 1
+#define CONFIG_SONIC_ENCODER 1
+#define CONFIG_SONIC_LS_ENCODER 1
+#define CONFIG_TRUEHD_ENCODER 1
+#define CONFIG_TTA_ENCODER 1
+#define CONFIG_VORBIS_ENCODER 1
+#define CONFIG_WAVPACK_ENCODER 1
+#define CONFIG_WMAV1_ENCODER 1
+#define CONFIG_WMAV2_ENCODER 1
+#define CONFIG_PCM_ALAW_ENCODER 1
+#define CONFIG_PCM_F32BE_ENCODER 1
+#define CONFIG_PCM_F32LE_ENCODER 1
+#define CONFIG_PCM_F64BE_ENCODER 1
+#define CONFIG_PCM_F64LE_ENCODER 1
+#define CONFIG_PCM_MULAW_ENCODER 1
+#define CONFIG_PCM_S8_ENCODER 1
+#define CONFIG_PCM_S8_PLANAR_ENCODER 1
+#define CONFIG_PCM_S16BE_ENCODER 1
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 1
+#define CONFIG_PCM_S16LE_ENCODER 1
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 1
+#define CONFIG_PCM_S24BE_ENCODER 1
+#define CONFIG_PCM_S24DAUD_ENCODER 1
+#define CONFIG_PCM_S24LE_ENCODER 1
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 1
+#define CONFIG_PCM_S32BE_ENCODER 1
+#define CONFIG_PCM_S32LE_ENCODER 1
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 1
+#define CONFIG_PCM_S64BE_ENCODER 1
+#define CONFIG_PCM_S64LE_ENCODER 1
+#define CONFIG_PCM_U8_ENCODER 1
+#define CONFIG_PCM_U16BE_ENCODER 1
+#define CONFIG_PCM_U16LE_ENCODER 1
+#define CONFIG_PCM_U24BE_ENCODER 1
+#define CONFIG_PCM_U24LE_ENCODER 1
+#define CONFIG_PCM_U32BE_ENCODER 1
+#define CONFIG_PCM_U32LE_ENCODER 1
+#define CONFIG_ROQ_DPCM_ENCODER 1
+#define CONFIG_ADPCM_ADX_ENCODER 1
+#define CONFIG_ADPCM_G722_ENCODER 1
+#define CONFIG_ADPCM_G726_ENCODER 1
+#define CONFIG_ADPCM_IMA_QT_ENCODER 1
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 1
+#define CONFIG_ADPCM_MS_ENCODER 1
+#define CONFIG_ADPCM_SWF_ENCODER 1
+#define CONFIG_ADPCM_YAMAHA_ENCODER 1
+#define CONFIG_SSA_ENCODER 1
+#define CONFIG_ASS_ENCODER 1
+#define CONFIG_DVBSUB_ENCODER 1
+#define CONFIG_DVDSUB_ENCODER 1
+#define CONFIG_MOVTEXT_ENCODER 1
+#define CONFIG_SRT_ENCODER 1
+#define CONFIG_SUBRIP_ENCODER 1
+#define CONFIG_TEXT_ENCODER 1
+#define CONFIG_WEBVTT_ENCODER 1
+#define CONFIG_XSUB_ENCODER 1
+#define CONFIG_AAC_AT_ENCODER 0
+#define CONFIG_ALAC_AT_ENCODER 0
+#define CONFIG_ILBC_AT_ENCODER 0
+#define CONFIG_PCM_ALAW_AT_ENCODER 0
+#define CONFIG_PCM_MULAW_AT_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_NVENC_ENCODER 0
+#define CONFIG_H264_OMX_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_H264_VAAPI_ENCODER 0
+#define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_NVENC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_HEVC_VAAPI_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MJPEG_VAAPI_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_MPEG2_VAAPI_ENCODER 0
+#define CONFIG_VP8_VAAPI_ENCODER 0
+#define CONFIG_ABENCH_FILTER 1
+#define CONFIG_ACOMPRESSOR_FILTER 1
+#define CONFIG_ACROSSFADE_FILTER 1
+#define CONFIG_ACRUSHER_FILTER 1
+#define CONFIG_ADELAY_FILTER 1
+#define CONFIG_AECHO_FILTER 1
+#define CONFIG_AEMPHASIS_FILTER 1
+#define CONFIG_AEVAL_FILTER 1
+#define CONFIG_AFADE_FILTER 1
+#define CONFIG_AFFTFILT_FILTER 1
+#define CONFIG_AFORMAT_FILTER 1
+#define CONFIG_AGATE_FILTER 1
+#define CONFIG_AINTERLEAVE_FILTER 1
+#define CONFIG_ALIMITER_FILTER 1
+#define CONFIG_ALLPASS_FILTER 1
+#define CONFIG_ALOOP_FILTER 1
+#define CONFIG_AMERGE_FILTER 1
+#define CONFIG_AMETADATA_FILTER 1
+#define CONFIG_AMIX_FILTER 1
+#define CONFIG_ANEQUALIZER_FILTER 1
+#define CONFIG_ANULL_FILTER 1
+#define CONFIG_APAD_FILTER 1
+#define CONFIG_APERMS_FILTER 1
+#define CONFIG_APHASER_FILTER 1
+#define CONFIG_APULSATOR_FILTER 1
+#define CONFIG_AREALTIME_FILTER 1
+#define CONFIG_ARESAMPLE_FILTER 1
+#define CONFIG_AREVERSE_FILTER 1
+#define CONFIG_ASELECT_FILTER 1
+#define CONFIG_ASENDCMD_FILTER 1
+#define CONFIG_ASETNSAMPLES_FILTER 1
+#define CONFIG_ASETPTS_FILTER 1
+#define CONFIG_ASETRATE_FILTER 1
+#define CONFIG_ASETTB_FILTER 1
+#define CONFIG_ASHOWINFO_FILTER 1
+#define CONFIG_ASIDEDATA_FILTER 1
+#define CONFIG_ASPLIT_FILTER 1
+#define CONFIG_ASTATS_FILTER 1
+#define CONFIG_ASTREAMSELECT_FILTER 1
+#define CONFIG_ATEMPO_FILTER 1
+#define CONFIG_ATRIM_FILTER 1
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 1
+#define CONFIG_BANDREJECT_FILTER 1
+#define CONFIG_BASS_FILTER 1
+#define CONFIG_BIQUAD_FILTER 1
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 1
+#define CONFIG_CHANNELSPLIT_FILTER 1
+#define CONFIG_CHORUS_FILTER 1
+#define CONFIG_COMPAND_FILTER 1
+#define CONFIG_COMPENSATIONDELAY_FILTER 1
+#define CONFIG_CRYSTALIZER_FILTER 1
+#define CONFIG_DCSHIFT_FILTER 1
+#define CONFIG_DYNAUDNORM_FILTER 1
+#define CONFIG_EARWAX_FILTER 1
+#define CONFIG_EBUR128_FILTER 1
+#define CONFIG_EQUALIZER_FILTER 1
+#define CONFIG_EXTRASTEREO_FILTER 1
+#define CONFIG_FIREQUALIZER_FILTER 1
+#define CONFIG_FLANGER_FILTER 1
+#define CONFIG_HDCD_FILTER 1
+#define CONFIG_HIGHPASS_FILTER 1
+#define CONFIG_JOIN_FILTER 1
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOUDNORM_FILTER 1
+#define CONFIG_LOWPASS_FILTER 1
+#define CONFIG_PAN_FILTER 1
+#define CONFIG_REPLAYGAIN_FILTER 1
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_RUBBERBAND_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 1
+#define CONFIG_SIDECHAINGATE_FILTER 1
+#define CONFIG_SILENCEDETECT_FILTER 1
+#define CONFIG_SILENCEREMOVE_FILTER 1
+#define CONFIG_SOFALIZER_FILTER 0
+#define CONFIG_STEREOTOOLS_FILTER 1
+#define CONFIG_STEREOWIDEN_FILTER 1
+#define CONFIG_TREBLE_FILTER 1
+#define CONFIG_TREMOLO_FILTER 1
+#define CONFIG_VIBRATO_FILTER 1
+#define CONFIG_VOLUME_FILTER 1
+#define CONFIG_VOLUMEDETECT_FILTER 1
+#define CONFIG_AEVALSRC_FILTER 1
+#define CONFIG_ANOISESRC_FILTER 1
+#define CONFIG_ANULLSRC_FILTER 1
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 1
+#define CONFIG_ANULLSINK_FILTER 1
+#define CONFIG_ALPHAEXTRACT_FILTER 1
+#define CONFIG_ALPHAMERGE_FILTER 1
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 1
+#define CONFIG_AVGBLUR_FILTER 1
+#define CONFIG_BBOX_FILTER 1
+#define CONFIG_BENCH_FILTER 1
+#define CONFIG_BITPLANENOISE_FILTER 1
+#define CONFIG_BLACKDETECT_FILTER 1
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 1
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_BWDIF_FILTER 1
+#define CONFIG_CHROMAKEY_FILTER 1
+#define CONFIG_CIESCOPE_FILTER 1
+#define CONFIG_CODECVIEW_FILTER 1
+#define CONFIG_COLORBALANCE_FILTER 1
+#define CONFIG_COLORCHANNELMIXER_FILTER 1
+#define CONFIG_COLORKEY_FILTER 1
+#define CONFIG_COLORLEVELS_FILTER 1
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COLORSPACE_FILTER 1
+#define CONFIG_CONVOLUTION_FILTER 1
+#define CONFIG_COPY_FILTER 1
+#define CONFIG_COREIMAGE_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 1
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 1
+#define CONFIG_DATASCOPE_FILTER 1
+#define CONFIG_DCTDNOIZ_FILTER 1
+#define CONFIG_DEBAND_FILTER 1
+#define CONFIG_DECIMATE_FILTER 1
+#define CONFIG_DEFLATE_FILTER 1
+#define CONFIG_DEINTERLACE_QSV_FILTER 0
+#define CONFIG_DEINTERLACE_VAAPI_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 1
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 1
+#define CONFIG_DETELECINE_FILTER 1
+#define CONFIG_DILATION_FILTER 1
+#define CONFIG_DISPLACE_FILTER 1
+#define CONFIG_DRAWBOX_FILTER 1
+#define CONFIG_DRAWGRAPH_FILTER 1
+#define CONFIG_DRAWGRID_FILTER 1
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 1
+#define CONFIG_ELBG_FILTER 1
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 1
+#define CONFIG_EXTRACTPLANES_FILTER 1
+#define CONFIG_FADE_FILTER 1
+#define CONFIG_FFTFILT_FILTER 1
+#define CONFIG_FIELD_FILTER 1
+#define CONFIG_FIELDHINT_FILTER 1
+#define CONFIG_FIELDMATCH_FILTER 1
+#define CONFIG_FIELDORDER_FILTER 1
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 1
+#define CONFIG_FPS_FILTER 1
+#define CONFIG_FRAMEPACK_FILTER 1
+#define CONFIG_FRAMERATE_FILTER 1
+#define CONFIG_FRAMESTEP_FILTER 1
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GBLUR_FILTER 1
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 1
+#define CONFIG_HALDCLUT_FILTER 1
+#define CONFIG_HFLIP_FILTER 1
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 1
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 1
+#define CONFIG_HSTACK_FILTER 1
+#define CONFIG_HUE_FILTER 1
+#define CONFIG_HWDOWNLOAD_FILTER 1
+#define CONFIG_HWMAP_FILTER 1
+#define CONFIG_HWUPLOAD_FILTER 1
+#define CONFIG_HWUPLOAD_CUDA_FILTER 0
+#define CONFIG_HYSTERESIS_FILTER 1
+#define CONFIG_IDET_FILTER 1
+#define CONFIG_IL_FILTER 1
+#define CONFIG_INFLATE_FILTER 1
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 1
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 1
+#define CONFIG_LOOP_FILTER 1
+#define CONFIG_LUT_FILTER 1
+#define CONFIG_LUT2_FILTER 1
+#define CONFIG_LUT3D_FILTER 1
+#define CONFIG_LUTRGB_FILTER 1
+#define CONFIG_LUTYUV_FILTER 1
+#define CONFIG_MASKEDCLAMP_FILTER 1
+#define CONFIG_MASKEDMERGE_FILTER 1
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 1
+#define CONFIG_MESTIMATE_FILTER 1
+#define CONFIG_METADATA_FILTER 1
+#define CONFIG_MIDEQUALIZER_FILTER 1
+#define CONFIG_MINTERPOLATE_FILTER 1
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 1
+#define CONFIG_NLMEANS_FILTER 1
+#define CONFIG_NNEDI_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 1
+#define CONFIG_NOISE_FILTER 1
+#define CONFIG_NULL_FILTER 1
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 1
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 1
+#define CONFIG_PALETTEGEN_FILTER 1
+#define CONFIG_PALETTEUSE_FILTER 1
+#define CONFIG_PERMS_FILTER 1
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 1
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PREMULTIPLY_FILTER 1
+#define CONFIG_PREWITT_FILTER 1
+#define CONFIG_PSNR_FILTER 1
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 1
+#define CONFIG_RANDOM_FILTER 1
+#define CONFIG_READEIA608_FILTER 1
+#define CONFIG_READVITC_FILTER 1
+#define CONFIG_REALTIME_FILTER 1
+#define CONFIG_REMAP_FILTER 1
+#define CONFIG_REMOVEGRAIN_FILTER 1
+#define CONFIG_REMOVELOGO_FILTER 1
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 1
+#define CONFIG_ROTATE_FILTER 1
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 1
+#define CONFIG_SCALE_NPP_FILTER 0
+#define CONFIG_SCALE_QSV_FILTER 0
+#define CONFIG_SCALE_VAAPI_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 1
+#define CONFIG_SELECT_FILTER 1
+#define CONFIG_SELECTIVECOLOR_FILTER 1
+#define CONFIG_SENDCMD_FILTER 1
+#define CONFIG_SEPARATEFIELDS_FILTER 1
+#define CONFIG_SETDAR_FILTER 1
+#define CONFIG_SETFIELD_FILTER 1
+#define CONFIG_SETPTS_FILTER 1
+#define CONFIG_SETSAR_FILTER 1
+#define CONFIG_SETTB_FILTER 1
+#define CONFIG_SHOWINFO_FILTER 1
+#define CONFIG_SHOWPALETTE_FILTER 1
+#define CONFIG_SHUFFLEFRAMES_FILTER 1
+#define CONFIG_SHUFFLEPLANES_FILTER 1
+#define CONFIG_SIDEDATA_FILTER 1
+#define CONFIG_SIGNALSTATS_FILTER 1
+#define CONFIG_SIGNATURE_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SOBEL_FILTER 1
+#define CONFIG_SPLIT_FILTER 1
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 1
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_STREAMSELECT_FILTER 1
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPRECT_FILTER 1
+#define CONFIG_SWAPUV_FILTER 1
+#define CONFIG_TBLEND_FILTER 1
+#define CONFIG_TELECINE_FILTER 1
+#define CONFIG_THRESHOLD_FILTER 1
+#define CONFIG_THUMBNAIL_FILTER 1
+#define CONFIG_TILE_FILTER 1
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 1
+#define CONFIG_TRIM_FILTER 1
+#define CONFIG_UNSHARP_FILTER 1
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VAGUEDENOISER_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 1
+#define CONFIG_VFLIP_FILTER 1
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 1
+#define CONFIG_VSTACK_FILTER 1
+#define CONFIG_W3FDIF_FILTER 1
+#define CONFIG_WAVEFORM_FILTER 1
+#define CONFIG_WEAVE_FILTER 1
+#define CONFIG_XBR_FILTER 1
+#define CONFIG_YADIF_FILTER 1
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 1
+#define CONFIG_ZSCALE_FILTER 0
+#define CONFIG_ALLRGB_FILTER 1
+#define CONFIG_ALLYUV_FILTER 1
+#define CONFIG_CELLAUTO_FILTER 1
+#define CONFIG_COLOR_FILTER 1
+#define CONFIG_COREIMAGESRC_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 1
+#define CONFIG_LIFE_FILTER 1
+#define CONFIG_MANDELBROT_FILTER 1
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 1
+#define CONFIG_RGBTESTSRC_FILTER 1
+#define CONFIG_SMPTEBARS_FILTER 1
+#define CONFIG_SMPTEHDBARS_FILTER 1
+#define CONFIG_TESTSRC_FILTER 1
+#define CONFIG_TESTSRC2_FILTER 1
+#define CONFIG_YUVTESTSRC_FILTER 1
+#define CONFIG_NULLSINK_FILTER 1
+#define CONFIG_ABITSCOPE_FILTER 1
+#define CONFIG_ADRAWGRAPH_FILTER 1
+#define CONFIG_AHISTOGRAM_FILTER 1
+#define CONFIG_APHASEMETER_FILTER 1
+#define CONFIG_AVECTORSCOPE_FILTER 1
+#define CONFIG_CONCAT_FILTER 1
+#define CONFIG_SHOWCQT_FILTER 1
+#define CONFIG_SHOWFREQS_FILTER 1
+#define CONFIG_SHOWSPECTRUM_FILTER 1
+#define CONFIG_SHOWSPECTRUMPIC_FILTER 1
+#define CONFIG_SHOWVOLUME_FILTER 1
+#define CONFIG_SHOWWAVES_FILTER 1
+#define CONFIG_SHOWWAVESPIC_FILTER 1
+#define CONFIG_SPECTRUMSYNTH_FILTER 1
+#define CONFIG_AMOVIE_FILTER 1
+#define CONFIG_MOVIE_FILTER 1
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_CUVID_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MEDIACODEC_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_CUVID_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_MEDIACODEC_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MJPEG_CUVID_HWACCEL 0
+#define CONFIG_MPEG1_CUVID_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_CUVID_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_MMAL_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_CUVID_HWACCEL 0
+#define CONFIG_MPEG4_MEDIACODEC_HWACCEL 0
+#define CONFIG_MPEG4_MMAL_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_CUVID_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_MMAL_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_VP8_CUVID_HWACCEL 0
+#define CONFIG_VP8_MEDIACODEC_HWACCEL 0
+#define CONFIG_VP8_QSV_HWACCEL 0
+#define CONFIG_VP9_CUVID_HWACCEL 0
+#define CONFIG_VP9_D3D11VA_HWACCEL 0
+#define CONFIG_VP9_DXVA2_HWACCEL 0
+#define CONFIG_VP9_MEDIACODEC_HWACCEL 0
+#define CONFIG_VP9_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_XCBGRAB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 1
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FIFO_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEHASH_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GSM_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HASH_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 1
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 1
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OGV_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SCC_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_TTA_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_CHROMAPRINT_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL2_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 1
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVAUDIO_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 1
+#define CONFIG_H264_PARSER 1
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 1
+#define CONFIG_MPEGAUDIO_PARSER 0
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 0
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_SIPR_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 0
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_XMA_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 1
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 1
+#define CONFIG_CONCAT_PROTOCOL 1
+#define CONFIG_CRYPTO_PROTOCOL 1
+#define CONFIG_DATA_PROTOCOL 1
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 1
+#define CONFIG_FILE_PROTOCOL 1
+#define CONFIG_FTP_PROTOCOL 1
+#define CONFIG_GOPHER_PROTOCOL 1
+#define CONFIG_HLS_PROTOCOL 1
+#define CONFIG_HTTP_PROTOCOL 1
+#define CONFIG_HTTPPROXY_PROTOCOL 1
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 1
+#define CONFIG_MMSH_PROTOCOL 1
+#define CONFIG_MMST_PROTOCOL 1
+#define CONFIG_MD5_PROTOCOL 1
+#define CONFIG_PIPE_PROTOCOL 1
+#define CONFIG_PROMPEG_PROTOCOL 1
+#define CONFIG_RTMP_PROTOCOL 1
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 1
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 1
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 1
+#define CONFIG_SUBFILE_PROTOCOL 1
+#define CONFIG_TEE_PROTOCOL 1
+#define CONFIG_TCP_PROTOCOL 1
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_SCHANNEL_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 1
+#define CONFIG_UDPLITE_PROTOCOL 1
+#define CONFIG_UNIX_PROTOCOL 1
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/zfsjx-commonlibs/MediaCompressLib/src/main/jni/ffmpeg.c b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/ffmpeg.c
new file mode 100644
index 00000000..2398f50f
--- /dev/null
+++ b/zfsjx-commonlibs/MediaCompressLib/src/main/jni/ffmpeg.c
@@ -0,0 +1,4795 @@
+/*
+ * Copyright (c) 2000-2003 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * multimedia converter based on the FFmpeg libraries
+ */
+
+#include "config.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include "stdatomic.h"
+#include
+
+#if HAVE_IO_H
+#include
+#endif
+#if HAVE_UNISTD_H
+#include
+#endif
+
+#include "include/libavformat/avformat.h"
+/* sherry #include "include/libavdevice/avdevice.h" sherry */
+#include "include/libswresample/swresample.h"
+#include "include/libavutil/opt.h"
+#include "include/libavutil/channel_layout.h"
+#include "include/libavutil/parseutils.h"
+#include "include/libavutil/samplefmt.h"
+#include "include/libavutil/fifo.h"
+#include "include/libavutil/hwcontext.h"
+/* sherry #include "include/libavutil/internal.h" sherry */
+#include "include/libavutil/intreadwrite.h"
+#include "include/libavutil/dict.h"
+#include "include/libavutil/display.h"
+#include "include/libavutil/mathematics.h"
+#include "include/libavutil/pixdesc.h"
+#include "include/libavutil/avstring.h"
+/* sherry #include "include/libavutil/libm.h" sherry */
+#include "include/libavutil/imgutils.h"
+#include "include/libavutil/timestamp.h"
+#include "include/libavutil/bprint.h"
+#include "include/libavutil/time.h"
+#include "include/libavutil/threadmessage.h"
+/* sherry #include "include/libavcodec/mathops.h" sherry */
+/* sherry #include "include/libavformat/os_support.h" sherry*/
+
+# include "include/libavfilter/avfilter.h"
+# include "include/libavfilter/buffersrc.h"
+# include "include/libavfilter/buffersink.h"
+
+#if HAVE_SYS_RESOURCE_H
+#include
+#include
+#include
+#elif HAVE_GETPROCESSTIMES
+#include
+#endif
+#if HAVE_GETPROCESSMEMORYINFO
+#include
+#include
+#endif
+#if HAVE_SETCONSOLECTRLHANDLER
+#include
+#endif
+
+
+#if HAVE_SYS_SELECT_H
+#include
+#endif
+
+#if HAVE_TERMIOS_H
+#include
+#include
+#include
+#include
+#elif HAVE_KBHIT
+#include
+#endif
+
+#if HAVE_PTHREADS
+#include
+#endif
+
+#include
+
+#include "ffmpeg.h"
+#include "cmdutils.h"
+
+#include "libavutil/avassert.h"
+
+const char program_name[] = "ffmpeg";
+const int program_birth_year = 2000;
+
+static FILE *vstats_file;
+
+const char *const forced_keyframes_const_names[] = {
+ "n",
+ "n_forced",
+ "prev_forced_n",
+ "prev_forced_t",
+ "t",
+ NULL
+};
+
+static void do_video_stats(OutputStream *ost, int frame_size);
+static int64_t getutime(void);
+static int64_t getmaxrss(void);
+static int ifilter_has_all_input_formats(FilterGraph *fg);
+
+static int run_as_daemon = 0;
+static int nb_frames_dup = 0;
+static unsigned dup_warning = 1000;
+static int nb_frames_drop = 0;
+static int64_t decode_error_stat[2];
+
+static int want_sdp = 1;
+
+static int current_time;
+AVIOContext *progress_avio = NULL;
+
+static uint8_t *subtitle_out;
+
+InputStream **input_streams = NULL;
+int nb_input_streams = 0;
+InputFile **input_files = NULL;
+int nb_input_files = 0;
+
+OutputStream **output_streams = NULL;
+int nb_output_streams = 0;
+OutputFile **output_files = NULL;
+int nb_output_files = 0;
+
+FilterGraph **filtergraphs;
+int nb_filtergraphs;
+
+#if HAVE_TERMIOS_H
+
+/* init terminal so that we can grab keys */
+static struct termios oldtty;
+static int restore_tty;
+#endif
+
+#if HAVE_PTHREADS
+static void free_input_threads(void);
+#endif
+
+/* sub2video hack:
+ Convert subtitles to video with alpha to insert them in filter graphs.
+ This is a temporary solution until libavfilter gets real subtitles support.
+ */
+
+static int sub2video_get_blank_frame(InputStream *ist)
+{
+ int ret;
+ AVFrame *frame = ist->sub2video.frame;
+
+ av_frame_unref(frame);
+ ist->sub2video.frame->width = ist->dec_ctx->width ? ist->dec_ctx->width : ist->sub2video.w;
+ ist->sub2video.frame->height = ist->dec_ctx->height ? ist->dec_ctx->height : ist->sub2video.h;
+ ist->sub2video.frame->format = AV_PIX_FMT_RGB32;
+ if ((ret = av_frame_get_buffer(frame, 32)) < 0)
+ return ret;
+ memset(frame->data[0], 0, frame->height * frame->linesize[0]);
+ return 0;
+}
+
+static void sub2video_copy_rect(uint8_t *dst, int dst_linesize, int w, int h,
+ AVSubtitleRect *r)
+{
+ uint32_t *pal, *dst2;
+ uint8_t *src, *src2;
+ int x, y;
+
+ if (r->type != SUBTITLE_BITMAP) {
+ av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n");
+ return;
+ }
+ if (r->x < 0 || r->x + r->w > w || r->y < 0 || r->y + r->h > h) {
+ av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle (%d %d %d %d) overflowing %d %d\n",
+ r->x, r->y, r->w, r->h, w, h
+ );
+ return;
+ }
+
+ dst += r->y * dst_linesize + r->x * 4;
+ src = r->data[0];
+ pal = (uint32_t *)r->data[1];
+ for (y = 0; y < r->h; y++) {
+ dst2 = (uint32_t *)dst;
+ src2 = src;
+ for (x = 0; x < r->w; x++)
+ *(dst2++) = pal[*(src2++)];
+ dst += dst_linesize;
+ src += r->linesize[0];
+ }
+}
+
+static void sub2video_push_ref(InputStream *ist, int64_t pts)
+{
+ AVFrame *frame = ist->sub2video.frame;
+ int i;
+
+ av_assert1(frame->data[0]);
+ ist->sub2video.last_pts = frame->pts = pts;
+ for (i = 0; i < ist->nb_filters; i++)
+ av_buffersrc_add_frame_flags(ist->filters[i]->filter, frame,
+ AV_BUFFERSRC_FLAG_KEEP_REF |
+ AV_BUFFERSRC_FLAG_PUSH);
+}
+
+void sub2video_update(InputStream *ist, AVSubtitle *sub)
+{
+ AVFrame *frame = ist->sub2video.frame;
+ int8_t *dst;
+ int dst_linesize;
+ int num_rects, i;
+ int64_t pts, end_pts;
+
+ if (!frame)
+ return;
+ if (sub) {
+ pts = av_rescale_q(sub->pts + sub->start_display_time * 1000LL,
+ AV_TIME_BASE_Q, ist->st->time_base);
+ end_pts = av_rescale_q(sub->pts + sub->end_display_time * 1000LL,
+ AV_TIME_BASE_Q, ist->st->time_base);
+ num_rects = sub->num_rects;
+ } else {
+ pts = ist->sub2video.end_pts;
+ end_pts = INT64_MAX;
+ num_rects = 0;
+ }
+ if (sub2video_get_blank_frame(ist) < 0) {
+ av_log(ist->dec_ctx, AV_LOG_ERROR,
+ "Impossible to get a blank canvas.\n");
+ return;
+ }
+ dst = frame->data [0];
+ dst_linesize = frame->linesize[0];
+ for (i = 0; i < num_rects; i++)
+ sub2video_copy_rect(dst, dst_linesize, frame->width, frame->height, sub->rects[i]);
+ sub2video_push_ref(ist, pts);
+ ist->sub2video.end_pts = end_pts;
+}
+
+static void sub2video_heartbeat(InputStream *ist, int64_t pts)
+{
+ InputFile *infile = input_files[ist->file_index];
+ int i, j, nb_reqs;
+ int64_t pts2;
+
+ /* When a frame is read from a file, examine all sub2video streams in
+ the same file and send the sub2video frame again. Otherwise, decoded
+ video frames could be accumulating in the filter graph while a filter
+ (possibly overlay) is desperately waiting for a subtitle frame. */
+ for (i = 0; i < infile->nb_streams; i++) {
+ InputStream *ist2 = input_streams[infile->ist_index + i];
+ if (!ist2->sub2video.frame)
+ continue;
+ /* subtitles seem to be usually muxed ahead of other streams;
+ if not, subtracting a larger time here is necessary */
+ pts2 = av_rescale_q(pts, ist->st->time_base, ist2->st->time_base) - 1;
+ /* do not send the heartbeat frame if the subtitle is already ahead */
+ if (pts2 <= ist2->sub2video.last_pts)
+ continue;
+ if (pts2 >= ist2->sub2video.end_pts || !ist2->sub2video.frame->data[0])
+ sub2video_update(ist2, NULL);
+ for (j = 0, nb_reqs = 0; j < ist2->nb_filters; j++)
+ nb_reqs += av_buffersrc_get_nb_failed_requests(ist2->filters[j]->filter);
+ if (nb_reqs)
+ sub2video_push_ref(ist2, pts2);
+ }
+}
+
+static void sub2video_flush(InputStream *ist)
+{
+ int i;
+
+ if (ist->sub2video.end_pts < INT64_MAX)
+ sub2video_update(ist, NULL);
+ for (i = 0; i < ist->nb_filters; i++)
+ av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
+}
+
+/* end of sub2video hack */
+
+static void term_exit_sigsafe(void)
+{
+#if HAVE_TERMIOS_H
+ if(restore_tty)
+ tcsetattr (0, TCSANOW, &oldtty);
+#endif
+}
+
+void term_exit(void)
+{
+ av_log(NULL, AV_LOG_QUIET, "%s", "");
+ term_exit_sigsafe();
+}
+
+static volatile int received_sigterm = 0;
+static volatile int received_nb_signals = 0;
+static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0);
+static volatile int ffmpeg_exited = 0;
+static int main_return_code = 0;
+
+static void
+sigterm_handler(int sig)
+{
+ received_sigterm = sig;
+ received_nb_signals++;
+ term_exit_sigsafe();
+ if(received_nb_signals > 3) {
+ write(2/*STDERR_FILENO*/, "Received > 3 system signals, hard exiting\n",
+ strlen("Received > 3 system signals, hard exiting\n"));
+
+ exit(123);
+ }
+}
+
+#if HAVE_SETCONSOLECTRLHANDLER
+static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
+{
+ av_log(NULL, AV_LOG_DEBUG, "\nReceived windows signal %ld\n", fdwCtrlType);
+
+ switch (fdwCtrlType)
+ {
+ case CTRL_C_EVENT:
+ case CTRL_BREAK_EVENT:
+ sigterm_handler(SIGINT);
+ return TRUE;
+
+ case CTRL_CLOSE_EVENT:
+ case CTRL_LOGOFF_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
+ sigterm_handler(SIGTERM);
+ /* Basically, with these 3 events, when we return from this method the
+ process is hard terminated, so stall as long as we need to
+ to try and let the main thread(s) clean up and gracefully terminate
+ (we have at most 5 seconds, but should be done far before that). */
+ while (!ffmpeg_exited) {
+ Sleep(0);
+ }
+ return TRUE;
+
+ default:
+ av_log(NULL, AV_LOG_ERROR, "Received unknown windows signal %ld\n", fdwCtrlType);
+ return FALSE;
+ }
+}
+#endif
+
+void term_init(void)
+{
+#if HAVE_TERMIOS_H
+ if (!run_as_daemon && stdin_interaction) {
+ struct termios tty;
+ if (tcgetattr (0, &tty) == 0) {
+ oldtty = tty;
+ restore_tty = 1;
+
+ tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
+ |INLCR|IGNCR|ICRNL|IXON);
+ tty.c_oflag |= OPOST;
+ tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
+ tty.c_cflag &= ~(CSIZE|PARENB);
+ tty.c_cflag |= CS8;
+ tty.c_cc[VMIN] = 1;
+ tty.c_cc[VTIME] = 0;
+
+ tcsetattr (0, TCSANOW, &tty);
+ }
+ signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */
+ }
+#endif
+
+ signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
+ signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
+#ifdef SIGXCPU
+ signal(SIGXCPU, sigterm_handler);
+#endif
+#if HAVE_SETCONSOLECTRLHANDLER
+ SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE);
+#endif
+}
+
+/* read a key without blocking */
+static int read_key(void)
+{
+ unsigned char ch;
+#if HAVE_TERMIOS_H
+ int n = 1;
+ struct timeval tv;
+ fd_set rfds;
+
+ FD_ZERO(&rfds);
+ FD_SET(0, &rfds);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ n = select(1, &rfds, NULL, NULL, &tv);
+ if (n > 0) {
+ n = read(0, &ch, 1);
+ if (n == 1)
+ return ch;
+
+ return n;
+ }
+#elif HAVE_KBHIT
+# if HAVE_PEEKNAMEDPIPE
+ static int is_pipe;
+ static HANDLE input_handle;
+ DWORD dw, nchars;
+ if(!input_handle){
+ input_handle = GetStdHandle(STD_INPUT_HANDLE);
+ is_pipe = !GetConsoleMode(input_handle, &dw);
+ }
+
+ if (is_pipe) {
+ /* When running under a GUI, you will end here. */
+ if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL)) {
+ // input pipe may have been closed by the program that ran ffmpeg
+ return -1;
+ }
+ //Read it
+ if(nchars != 0) {
+ read(0, &ch, 1);
+ return ch;
+ }else{
+ return -1;
+ }
+ }
+# endif
+ if(kbhit())
+ return(getch());
+#endif
+ return -1;
+}
+
+static int decode_interrupt_cb(void *ctx)
+{
+ return received_nb_signals > atomic_load(&transcode_init_done);
+}
+
+const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
+
+static void ffmpeg_cleanup(int ret)
+{
+ int i, j;
+
+ if (do_benchmark) {
+ int maxrss = getmaxrss() / 1024;
+ av_log(NULL, AV_LOG_INFO, "bench: maxrss=%ikB\n", maxrss);
+ }
+
+ for (i = 0; i < nb_filtergraphs; i++) {
+ FilterGraph *fg = filtergraphs[i];
+ avfilter_graph_free(&fg->graph);
+ for (j = 0; j < fg->nb_inputs; j++) {
+ while (av_fifo_size(fg->inputs[j]->frame_queue)) {
+ AVFrame *frame;
+ av_fifo_generic_read(fg->inputs[j]->frame_queue, &frame,
+ sizeof(frame), NULL);
+ av_frame_free(&frame);
+ }
+ av_fifo_free(fg->inputs[j]->frame_queue);
+ if (fg->inputs[j]->ist->sub2video.sub_queue) {
+ while (av_fifo_size(fg->inputs[j]->ist->sub2video.sub_queue)) {
+ AVSubtitle sub;
+ av_fifo_generic_read(fg->inputs[j]->ist->sub2video.sub_queue,
+ &sub, sizeof(sub), NULL);
+ avsubtitle_free(&sub);
+ }
+ av_fifo_free(fg->inputs[j]->ist->sub2video.sub_queue);
+ }
+ av_buffer_unref(&fg->inputs[j]->hw_frames_ctx);
+ av_freep(&fg->inputs[j]->name);
+ av_freep(&fg->inputs[j]);
+ }
+ av_freep(&fg->inputs);
+ for (j = 0; j < fg->nb_outputs; j++) {
+ av_freep(&fg->outputs[j]->name);
+ av_freep(&fg->outputs[j]->formats);
+ av_freep(&fg->outputs[j]->channel_layouts);
+ av_freep(&fg->outputs[j]->sample_rates);
+ av_freep(&fg->outputs[j]);
+ }
+ av_freep(&fg->outputs);
+ av_freep(&fg->graph_desc);
+
+ av_freep(&filtergraphs[i]);
+ }
+ av_freep(&filtergraphs);
+
+ av_freep(&subtitle_out);
+
+ /* close files */
+ for (i = 0; i < nb_output_files; i++) {
+ OutputFile *of = output_files[i];
+ AVFormatContext *s;
+ if (!of)
+ continue;
+ s = of->ctx;
+ if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE))
+ avio_closep(&s->pb);
+ avformat_free_context(s);
+ av_dict_free(&of->opts);
+
+ av_freep(&output_files[i]);
+ }
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+
+ if (!ost)
+ continue;
+
+ for (j = 0; j < ost->nb_bitstream_filters; j++)
+ av_bsf_free(&ost->bsf_ctx[j]);
+ av_freep(&ost->bsf_ctx);
+ av_freep(&ost->bsf_extradata_updated);
+
+ av_frame_free(&ost->filtered_frame);
+ av_frame_free(&ost->last_frame);
+ av_dict_free(&ost->encoder_opts);
+
+ av_parser_close(ost->parser);
+ avcodec_free_context(&ost->parser_avctx);
+
+ av_freep(&ost->forced_keyframes);
+ av_expr_free(ost->forced_keyframes_pexpr);
+ av_freep(&ost->avfilter);
+ av_freep(&ost->logfile_prefix);
+
+ av_freep(&ost->audio_channels_map);
+ ost->audio_channels_mapped = 0;
+
+ av_dict_free(&ost->sws_dict);
+
+ avcodec_free_context(&ost->enc_ctx);
+ avcodec_parameters_free(&ost->ref_par);
+
+ if (ost->muxing_queue) {
+ while (av_fifo_size(ost->muxing_queue)) {
+ AVPacket pkt;
+ av_fifo_generic_read(ost->muxing_queue, &pkt, sizeof(pkt), NULL);
+ av_packet_unref(&pkt);
+ }
+ av_fifo_freep(&ost->muxing_queue);
+ }
+
+ av_freep(&output_streams[i]);
+ }
+#if HAVE_PTHREADS
+ free_input_threads();
+#endif
+ for (i = 0; i < nb_input_files; i++) {
+ avformat_close_input(&input_files[i]->ctx);
+ av_freep(&input_files[i]);
+ }
+ for (i = 0; i < nb_input_streams; i++) {
+ InputStream *ist = input_streams[i];
+
+ av_frame_free(&ist->decoded_frame);
+ av_frame_free(&ist->filter_frame);
+ av_dict_free(&ist->decoder_opts);
+ avsubtitle_free(&ist->prev_sub.subtitle);
+ av_frame_free(&ist->sub2video.frame);
+ av_freep(&ist->filters);
+ av_freep(&ist->hwaccel_device);
+ av_freep(&ist->dts_buffer);
+
+ avcodec_free_context(&ist->dec_ctx);
+
+ av_freep(&input_streams[i]);
+ }
+
+ if (vstats_file) {
+ if (fclose(vstats_file))
+ av_log(NULL, AV_LOG_ERROR,
+ "Error closing vstats file, loss of information possible: %s\n",
+ av_err2str(AVERROR(errno)));
+ }
+ av_freep(&vstats_filename);
+
+ av_freep(&input_streams);
+ av_freep(&input_files);
+ av_freep(&output_streams);
+ av_freep(&output_files);
+
+ uninit_opts();
+
+ avformat_network_deinit();
+
+ if (received_sigterm) {
+ av_log(NULL, AV_LOG_INFO, "Exiting normally, received signal %d.\n",
+ (int) received_sigterm);
+ } else if (ret && atomic_load(&transcode_init_done)) {
+ av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
+ }
+ term_exit();
+ ffmpeg_exited = 1;
+ nb_filtergraphs = 0;
+ nb_output_files = 0;
+ nb_output_streams = 0;
+ nb_input_files = 0;
+ nb_input_streams = 0;
+}
+
+void remove_avoptions(AVDictionary **a, AVDictionary *b)
+{
+ AVDictionaryEntry *t = NULL;
+
+ while ((t = av_dict_get(b, "", t, AV_DICT_IGNORE_SUFFIX))) {
+ av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
+ }
+}
+
+void assert_avoptions(AVDictionary *m)
+{
+ AVDictionaryEntry *t;
+ if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
+ av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
+ exit_program(1);
+ }
+}
+
+static void abort_codec_experimental(AVCodec *c, int encoder)
+{
+ exit_program(1);
+}
+
+static void update_benchmark(const char *fmt, ...)
+{
+ if (do_benchmark_all) {
+ int64_t t = getutime();
+ va_list va;
+ char buf[1024];
+
+ if (fmt) {
+ va_start(va, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, va);
+ va_end(va);
+ av_log(NULL, AV_LOG_INFO, "bench: %8"PRIu64" %s \n", t - current_time, buf);
+ }
+ current_time = t;
+ }
+}
+
+static void close_all_output_streams(OutputStream *ost, OSTFinished this_stream, OSTFinished others)
+{
+ int i;
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost2 = output_streams[i];
+ ost2->finished |= ost == ost2 ? this_stream : others;
+ }
+}
+
+static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
+{
+ AVFormatContext *s = of->ctx;
+ AVStream *st = ost->st;
+ int ret;
+
+ if (!of->header_written) {
+ AVPacket tmp_pkt = {0};
+ /* the muxer is not initialized yet, buffer the packet */
+ if (!av_fifo_space(ost->muxing_queue)) {
+ int new_size = FFMIN(2 * av_fifo_size(ost->muxing_queue),
+ ost->max_muxing_queue_size);
+ if (new_size <= av_fifo_size(ost->muxing_queue)) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Too many packets buffered for output stream %d:%d.\n",
+ ost->file_index, ost->st->index);
+ exit_program(1);
+ }
+ ret = av_fifo_realloc2(ost->muxing_queue, new_size);
+ if (ret < 0)
+ exit_program(1);
+ }
+ ret = av_packet_ref(&tmp_pkt, pkt);
+ if (ret < 0)
+ exit_program(1);
+ av_fifo_generic_write(ost->muxing_queue, &tmp_pkt, sizeof(tmp_pkt), NULL);
+ av_packet_unref(pkt);
+ return;
+ }
+
+ if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && video_sync_method == VSYNC_DROP) ||
+ (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0))
+ pkt->pts = pkt->dts = AV_NOPTS_VALUE;
+
+ /*
+ * Audio encoders may split the packets -- #frames in != #packets out.
+ * But there is no reordering, so we can limit the number of output packets
+ * by simply dropping them here.
+ * Counting encoded video frames needs to be done separately because of
+ * reordering, see do_video_out()
+ */
+ if (!(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->encoding_needed)) {
+ if (ost->frame_number >= ost->max_frames) {
+ av_packet_unref(pkt);
+ return;
+ }
+ ost->frame_number++;
+ }
+ if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+ int i;
+ uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS,
+ NULL);
+ ost->quality = sd ? AV_RL32(sd) : -1;
+ ost->pict_type = sd ? sd[4] : AV_PICTURE_TYPE_NONE;
+
+ for (i = 0; ierror); i++) {
+ if (sd && i < sd[5])
+ ost->error[i] = AV_RL64(sd + 8 + 8*i);
+ else
+ ost->error[i] = -1;
+ }
+
+ if (ost->frame_rate.num && ost->is_cfr) {
+ if (pkt->duration > 0)
+ av_log(NULL, AV_LOG_WARNING, "Overriding packet duration by frame rate, this should not happen\n");
+ pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
+ ost->mux_timebase);
+ }
+ }
+
+ av_packet_rescale_ts(pkt, ost->mux_timebase, ost->st->time_base);
+
+ if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
+ if (pkt->dts != AV_NOPTS_VALUE &&
+ pkt->pts != AV_NOPTS_VALUE &&
+ pkt->dts > pkt->pts) {
+ av_log(s, AV_LOG_WARNING, "Invalid DTS: %"PRId64" PTS: %"PRId64" in output stream %d:%d, replacing by guess\n",
+ pkt->dts, pkt->pts,
+ ost->file_index, ost->st->index);
+ pkt->pts =
+ pkt->dts = pkt->pts + pkt->dts + ost->last_mux_dts + 1
+ - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1)
+ - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1);
+ }
+ if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
+ pkt->dts != AV_NOPTS_VALUE &&
+ !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) &&
+ ost->last_mux_dts != AV_NOPTS_VALUE) {
+ int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT);
+ if (pkt->dts < max) {
+ int loglevel = max - pkt->dts > 2 || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ? AV_LOG_WARNING : AV_LOG_DEBUG;
+ av_log(s, loglevel, "Non-monotonous DTS in output stream "
+ "%d:%d; previous: %"PRId64", current: %"PRId64"; ",
+ ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts);
+ if (exit_on_error) {
+ av_log(NULL, AV_LOG_FATAL, "aborting.\n");
+ exit_program(1);
+ }
+ av_log(s, loglevel, "changing to %"PRId64". This may result "
+ "in incorrect timestamps in the output file.\n",
+ max);
+ if (pkt->pts >= pkt->dts)
+ pkt->pts = FFMAX(pkt->pts, max);
+ pkt->dts = max;
+ }
+ }
+ }
+ ost->last_mux_dts = pkt->dts;
+
+ ost->data_size += pkt->size;
+ ost->packets_written++;
+
+ pkt->stream_index = ost->index;
+
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "muxer <- type:%s "
+ "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s size:%d\n",
+ av_get_media_type_string(ost->enc_ctx->codec_type),
+ av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->st->time_base),
+ av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->st->time_base),
+ pkt->size
+ );
+ }
+
+ ret = av_interleaved_write_frame(s, pkt);
+ if (ret < 0) {
+ print_error("av_interleaved_write_frame()", ret);
+ main_return_code = 1;
+ close_all_output_streams(ost, MUXER_FINISHED | ENCODER_FINISHED, ENCODER_FINISHED);
+ }
+ av_packet_unref(pkt);
+}
+
+static void close_output_stream(OutputStream *ost)
+{
+ OutputFile *of = output_files[ost->file_index];
+
+ ost->finished |= ENCODER_FINISHED;
+ if (of->shortest) {
+ int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, ost->enc_ctx->time_base, AV_TIME_BASE_Q);
+ of->recording_time = FFMIN(of->recording_time, end);
+ }
+}
+
+static void output_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
+{
+ int ret = 0;
+
+ /* apply the output bitstream filters, if any */
+ if (ost->nb_bitstream_filters) {
+ int idx;
+
+ ret = av_bsf_send_packet(ost->bsf_ctx[0], pkt);
+ if (ret < 0)
+ goto finish;
+
+ idx = 1;
+ while (idx) {
+ /* get a packet from the previous filter up the chain */
+ ret = av_bsf_receive_packet(ost->bsf_ctx[idx - 1], pkt);
+ if (ret == AVERROR(EAGAIN)) {
+ ret = 0;
+ idx--;
+ continue;
+ } else if (ret < 0)
+ goto finish;
+ /* HACK! - aac_adtstoasc updates extradata after filtering the first frame when
+ * the api states this shouldn't happen after init(). Propagate it here to the
+ * muxer and to the next filters in the chain to workaround this.
+ * TODO/FIXME - Make aac_adtstoasc use new packet side data instead of changing
+ * par_out->extradata and adapt muxers accordingly to get rid of this. */
+ if (!(ost->bsf_extradata_updated[idx - 1] & 1)) {
+ ret = avcodec_parameters_copy(ost->st->codecpar, ost->bsf_ctx[idx - 1]->par_out);
+ if (ret < 0)
+ goto finish;
+ ost->bsf_extradata_updated[idx - 1] |= 1;
+ }
+
+ /* send it to the next filter down the chain or to the muxer */
+ if (idx < ost->nb_bitstream_filters) {
+ /* HACK/FIXME! - See above */
+ if (!(ost->bsf_extradata_updated[idx] & 2)) {
+ ret = avcodec_parameters_copy(ost->bsf_ctx[idx]->par_out, ost->bsf_ctx[idx - 1]->par_out);
+ if (ret < 0)
+ goto finish;
+ ost->bsf_extradata_updated[idx] |= 2;
+ }
+ ret = av_bsf_send_packet(ost->bsf_ctx[idx], pkt);
+ if (ret < 0)
+ goto finish;
+ idx++;
+ } else
+ write_packet(of, pkt, ost);
+ }
+ } else
+ write_packet(of, pkt, ost);
+
+finish:
+ if (ret < 0 && ret != AVERROR_EOF) {
+ av_log(NULL, AV_LOG_ERROR, "Error applying bitstream filters to an output "
+ "packet for stream #%d:%d.\n", ost->file_index, ost->index);
+ if(exit_on_error)
+ exit_program(1);
+ }
+}
+
+static int check_recording_time(OutputStream *ost)
+{
+ OutputFile *of = output_files[ost->file_index];
+
+ if (of->recording_time != INT64_MAX &&
+ av_compare_ts(ost->sync_opts - ost->first_pts, ost->enc_ctx->time_base, of->recording_time,
+ AV_TIME_BASE_Q) >= 0) {
+ close_output_stream(ost);
+ return 0;
+ }
+ return 1;
+}
+
+static void do_audio_out(OutputFile *of, OutputStream *ost,
+ AVFrame *frame)
+{
+ AVCodecContext *enc = ost->enc_ctx;
+ AVPacket pkt;
+ int ret;
+
+ av_init_packet(&pkt);
+ pkt.data = NULL;
+ pkt.size = 0;
+
+ if (!check_recording_time(ost))
+ return;
+
+ if (frame->pts == AV_NOPTS_VALUE || audio_sync_method < 0)
+ frame->pts = ost->sync_opts;
+ ost->sync_opts = frame->pts + frame->nb_samples;
+ ost->samples_encoded += frame->nb_samples;
+ ost->frames_encoded++;
+
+ av_assert0(pkt.size || !pkt.data);
+ update_benchmark(NULL);
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder <- type:audio "
+ "frame_pts:%s frame_pts_time:%s time_base:%d/%d\n",
+ av_ts2str(frame->pts), av_ts2timestr(frame->pts, &enc->time_base),
+ enc->time_base.num, enc->time_base.den);
+ }
+
+ ret = avcodec_send_frame(enc, frame);
+ if (ret < 0)
+ goto error;
+
+ while (1) {
+ ret = avcodec_receive_packet(enc, &pkt);
+ if (ret == AVERROR(EAGAIN))
+ break;
+ if (ret < 0)
+ goto error;
+
+ update_benchmark("encode_audio %d.%d", ost->file_index, ost->index);
+
+ av_packet_rescale_ts(&pkt, enc->time_base, ost->mux_timebase);
+
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder -> type:audio "
+ "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n",
+ av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &enc->time_base),
+ av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &enc->time_base));
+ }
+
+ output_packet(of, &pkt, ost);
+ }
+
+ return;
+error:
+ av_log(NULL, AV_LOG_FATAL, "Audio encoding failed\n");
+ exit_program(1);
+}
+
+static void do_subtitle_out(OutputFile *of,
+ OutputStream *ost,
+ AVSubtitle *sub)
+{
+ int subtitle_out_max_size = 1024 * 1024;
+ int subtitle_out_size, nb, i;
+ AVCodecContext *enc;
+ AVPacket pkt;
+ int64_t pts;
+
+ if (sub->pts == AV_NOPTS_VALUE) {
+ av_log(NULL, AV_LOG_ERROR, "Subtitle packets must have a pts\n");
+ if (exit_on_error)
+ exit_program(1);
+ return;
+ }
+
+ enc = ost->enc_ctx;
+
+ if (!subtitle_out) {
+ subtitle_out = av_malloc(subtitle_out_max_size);
+ if (!subtitle_out) {
+ av_log(NULL, AV_LOG_FATAL, "Failed to allocate subtitle_out\n");
+ exit_program(1);
+ }
+ }
+
+ /* Note: DVB subtitle need one packet to draw them and one other
+ packet to clear them */
+ /* XXX: signal it in the codec context ? */
+ if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE)
+ nb = 2;
+ else
+ nb = 1;
+
+ /* shift timestamp to honor -ss and make check_recording_time() work with -t */
+ pts = sub->pts;
+ if (output_files[ost->file_index]->start_time != AV_NOPTS_VALUE)
+ pts -= output_files[ost->file_index]->start_time;
+ for (i = 0; i < nb; i++) {
+ unsigned save_num_rects = sub->num_rects;
+
+ ost->sync_opts = av_rescale_q(pts, AV_TIME_BASE_Q, enc->time_base);
+ if (!check_recording_time(ost))
+ return;
+
+ sub->pts = pts;
+ // start_display_time is required to be 0
+ sub->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, AV_TIME_BASE_Q);
+ sub->end_display_time -= sub->start_display_time;
+ sub->start_display_time = 0;
+ if (i == 1)
+ sub->num_rects = 0;
+
+ ost->frames_encoded++;
+
+ subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
+ subtitle_out_max_size, sub);
+ if (i == 1)
+ sub->num_rects = save_num_rects;
+ if (subtitle_out_size < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Subtitle encoding failed\n");
+ exit_program(1);
+ }
+
+ av_init_packet(&pkt);
+ pkt.data = subtitle_out;
+ pkt.size = subtitle_out_size;
+ pkt.pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->mux_timebase);
+ pkt.duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->mux_timebase);
+ if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
+ /* XXX: the pts correction is handled here. Maybe handling
+ it in the codec would be better */
+ if (i == 0)
+ pkt.pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, ost->mux_timebase);
+ else
+ pkt.pts += av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->mux_timebase);
+ }
+ pkt.dts = pkt.pts;
+ output_packet(of, &pkt, ost);
+ }
+}
+
+static void do_video_out(OutputFile *of,
+ OutputStream *ost,
+ AVFrame *next_picture,
+ double sync_ipts)
+{
+ int ret, format_video_sync;
+ AVPacket pkt;
+ AVCodecContext *enc = ost->enc_ctx;
+ AVCodecParameters *mux_par = ost->st->codecpar;
+ AVRational frame_rate;
+ int nb_frames, nb0_frames, i;
+ double delta, delta0;
+ double duration = 0;
+ int frame_size = 0;
+ InputStream *ist = NULL;
+ AVFilterContext *filter = ost->filter->filter;
+
+ if (ost->source_index >= 0)
+ ist = input_streams[ost->source_index];
+
+ frame_rate = av_buffersink_get_frame_rate(filter);
+ if (frame_rate.num > 0 && frame_rate.den > 0)
+ duration = 1/(av_q2d(frame_rate) * av_q2d(enc->time_base));
+
+ if(ist && ist->st->start_time != AV_NOPTS_VALUE && ist->st->first_dts != AV_NOPTS_VALUE && ost->frame_rate.num)
+ duration = FFMIN(duration, 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base)));
+
+ if (!ost->filters_script &&
+ !ost->filters &&
+ next_picture &&
+ ist &&
+ lrintf(av_frame_get_pkt_duration(next_picture) * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) {
+ duration = lrintf(av_frame_get_pkt_duration(next_picture) * av_q2d(ist->st->time_base) / av_q2d(enc->time_base));
+ }
+
+ if (!next_picture) {
+ //end, flushing
+ /* sherry nb0_frames = nb_frames = mid_pred(ost->last_nb0_frames[0],
+ ost->last_nb0_frames[1],
+ ost->last_nb0_frames[2]); sherry */
+ } else {
+ delta0 = sync_ipts - ost->sync_opts; // delta0 is the "drift" between the input frame (next_picture) and where it would fall in the output.
+ delta = delta0 + duration;
+
+ /* by default, we output a single frame */
+ nb0_frames = 0; // tracks the number of times the PREVIOUS frame should be duplicated, mostly for variable framerate (VFR)
+ nb_frames = 1;
+
+ format_video_sync = video_sync_method;
+ if (format_video_sync == VSYNC_AUTO) {
+ if(!strcmp(of->ctx->oformat->name, "avi")) {
+ format_video_sync = VSYNC_VFR;
+ } else
+ format_video_sync = (of->ctx->oformat->flags & AVFMT_VARIABLE_FPS) ? ((of->ctx->oformat->flags & AVFMT_NOTIMESTAMPS) ? VSYNC_PASSTHROUGH : VSYNC_VFR) : VSYNC_CFR;
+ if ( ist
+ && format_video_sync == VSYNC_CFR
+ && input_files[ist->file_index]->ctx->nb_streams == 1
+ && input_files[ist->file_index]->input_ts_offset == 0) {
+ format_video_sync = VSYNC_VSCFR;
+ }
+ if (format_video_sync == VSYNC_CFR && copy_ts) {
+ format_video_sync = VSYNC_VSCFR;
+ }
+ }
+ ost->is_cfr = (format_video_sync == VSYNC_CFR || format_video_sync == VSYNC_VSCFR);
+
+ if (delta0 < 0 &&
+ delta > 0 &&
+ format_video_sync != VSYNC_PASSTHROUGH &&
+ format_video_sync != VSYNC_DROP) {
+ if (delta0 < -0.6) {
+ av_log(NULL, AV_LOG_WARNING, "Past duration %f too large\n", -delta0);
+ } else
+ av_log(NULL, AV_LOG_DEBUG, "Clipping frame in rate conversion by %f\n", -delta0);
+ sync_ipts = ost->sync_opts;
+ duration += delta0;
+ delta0 = 0;
+ }
+
+ switch (format_video_sync) {
+ case VSYNC_VSCFR:
+ if (ost->frame_number == 0 && delta0 >= 0.5) {
+ av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta0));
+ delta = duration;
+ delta0 = 0;
+ ost->sync_opts = lrint(sync_ipts);
+ }
+ case VSYNC_CFR:
+ // FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
+ if (frame_drop_threshold && delta < frame_drop_threshold && ost->frame_number) {
+ nb_frames = 0;
+ } else if (delta < -1.1)
+ nb_frames = 0;
+ else if (delta > 1.1) {
+ nb_frames = lrintf(delta);
+ if (delta0 > 1.1)
+ nb0_frames = lrintf(delta0 - 0.6);
+ }
+ break;
+ case VSYNC_VFR:
+ if (delta <= -0.6)
+ nb_frames = 0;
+ else if (delta > 0.6)
+ ost->sync_opts = lrint(sync_ipts);
+ break;
+ case VSYNC_DROP:
+ case VSYNC_PASSTHROUGH:
+ ost->sync_opts = lrint(sync_ipts);
+ break;
+ default:
+ av_assert0(0);
+ }
+ }
+
+ nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number);
+ nb0_frames = FFMIN(nb0_frames, nb_frames);
+
+ memmove(ost->last_nb0_frames + 1,
+ ost->last_nb0_frames,
+ sizeof(ost->last_nb0_frames[0]) * (FF_ARRAY_ELEMS(ost->last_nb0_frames) - 1));
+ ost->last_nb0_frames[0] = nb0_frames;
+
+ if (nb0_frames == 0 && ost->last_dropped) {
+ nb_frames_drop++;
+ av_log(NULL, AV_LOG_VERBOSE,
+ "*** dropping frame %d from stream %d at ts %"PRId64"\n",
+ ost->frame_number, ost->st->index, ost->last_frame->pts);
+ }
+ if (nb_frames > (nb0_frames && ost->last_dropped) + (nb_frames > nb0_frames)) {
+ if (nb_frames > dts_error_threshold * 30) {
+ av_log(NULL, AV_LOG_ERROR, "%d frame duplication too large, skipping\n", nb_frames - 1);
+ nb_frames_drop++;
+ return;
+ }
+ nb_frames_dup += nb_frames - (nb0_frames && ost->last_dropped) - (nb_frames > nb0_frames);
+ av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\n", nb_frames - 1);
+ if (nb_frames_dup > dup_warning) {
+ av_log(NULL, AV_LOG_WARNING, "More than %d frames duplicated\n", dup_warning);
+ dup_warning *= 10;
+ }
+ }
+ ost->last_dropped = nb_frames == nb0_frames && next_picture;
+
+ /* duplicates frame if needed */
+ for (i = 0; i < nb_frames; i++) {
+ AVFrame *in_picture;
+ av_init_packet(&pkt);
+ pkt.data = NULL;
+ pkt.size = 0;
+
+ if (i < nb0_frames && ost->last_frame) {
+ in_picture = ost->last_frame;
+ } else
+ in_picture = next_picture;
+
+ if (!in_picture)
+ return;
+
+ in_picture->pts = ost->sync_opts;
+
+#if 1
+ if (!check_recording_time(ost))
+#else
+ if (ost->frame_number >= ost->max_frames)
+#endif
+ return;
+
+#if FF_API_LAVF_FMT_RAWPICTURE
+ if (of->ctx->oformat->flags & AVFMT_RAWPICTURE &&
+ enc->codec->id == AV_CODEC_ID_RAWVIDEO) {
+ /* raw pictures are written as AVPicture structure to
+ avoid any copies. We support temporarily the older
+ method. */
+ if (in_picture->interlaced_frame)
+ mux_par->field_order = in_picture->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
+ else
+ mux_par->field_order = AV_FIELD_PROGRESSIVE;
+ pkt.data = (uint8_t *)in_picture;
+ pkt.size = sizeof(AVPicture);
+ pkt.pts = av_rescale_q(in_picture->pts, enc->time_base, ost->mux_timebase);
+ pkt.flags |= AV_PKT_FLAG_KEY;
+
+ output_packet(of, &pkt, ost);
+ } else
+#endif
+ {
+ int forced_keyframe = 0;
+ double pts_time;
+
+ if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) &&
+ ost->top_field_first >= 0)
+ in_picture->top_field_first = !!ost->top_field_first;
+
+ if (in_picture->interlaced_frame) {
+ if (enc->codec->id == AV_CODEC_ID_MJPEG)
+ mux_par->field_order = in_picture->top_field_first ? AV_FIELD_TT:AV_FIELD_BB;
+ else
+ mux_par->field_order = in_picture->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
+ } else
+ mux_par->field_order = AV_FIELD_PROGRESSIVE;
+
+ in_picture->quality = enc->global_quality;
+ in_picture->pict_type = 0;
+
+ pts_time = in_picture->pts != AV_NOPTS_VALUE ?
+ in_picture->pts * av_q2d(enc->time_base) : NAN;
+ if (ost->forced_kf_index < ost->forced_kf_count &&
+ in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
+ ost->forced_kf_index++;
+ forced_keyframe = 1;
+ } else if (ost->forced_keyframes_pexpr) {
+ double res;
+ ost->forced_keyframes_expr_const_values[FKF_T] = pts_time;
+ res = av_expr_eval(ost->forced_keyframes_pexpr,
+ ost->forced_keyframes_expr_const_values, NULL);
+ /* sherry ff_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f prev_forced_t:%f -> res:%f\n",
+ ost->forced_keyframes_expr_const_values[FKF_N],
+ ost->forced_keyframes_expr_const_values[FKF_N_FORCED],
+ ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N],
+ ost->forced_keyframes_expr_const_values[FKF_T],
+ ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T],
+ res); sherry */
+ if (res) {
+ forced_keyframe = 1;
+ ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] =
+ ost->forced_keyframes_expr_const_values[FKF_N];
+ ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] =
+ ost->forced_keyframes_expr_const_values[FKF_T];
+ ost->forced_keyframes_expr_const_values[FKF_N_FORCED] += 1;
+ }
+
+ ost->forced_keyframes_expr_const_values[FKF_N] += 1;
+ } else if ( ost->forced_keyframes
+ && !strncmp(ost->forced_keyframes, "source", 6)
+ && in_picture->key_frame==1) {
+ forced_keyframe = 1;
+ }
+
+ if (forced_keyframe) {
+ in_picture->pict_type = AV_PICTURE_TYPE_I;
+ av_log(NULL, AV_LOG_DEBUG, "Forced keyframe at time %f\n", pts_time);
+ }
+
+ update_benchmark(NULL);
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder <- type:video "
+ "frame_pts:%s frame_pts_time:%s time_base:%d/%d\n",
+ av_ts2str(in_picture->pts), av_ts2timestr(in_picture->pts, &enc->time_base),
+ enc->time_base.num, enc->time_base.den);
+ }
+
+ ost->frames_encoded++;
+
+ ret = avcodec_send_frame(enc, in_picture);
+ if (ret < 0)
+ goto error;
+
+ while (1) {
+ ret = avcodec_receive_packet(enc, &pkt);
+ update_benchmark("encode_video %d.%d", ost->file_index, ost->index);
+ if (ret == AVERROR(EAGAIN))
+ break;
+ if (ret < 0)
+ goto error;
+
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder -> type:video "
+ "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n",
+ av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &enc->time_base),
+ av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &enc->time_base));
+ }
+
+ if (pkt.pts == AV_NOPTS_VALUE && !(enc->codec->capabilities & AV_CODEC_CAP_DELAY))
+ pkt.pts = ost->sync_opts;
+
+ av_packet_rescale_ts(&pkt, enc->time_base, ost->mux_timebase);
+
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "encoder -> type:video "
+ "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n",
+ av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &ost->mux_timebase),
+ av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->mux_timebase));
+ }
+
+ frame_size = pkt.size;
+ output_packet(of, &pkt, ost);
+
+ /* if two pass, output log */
+ if (ost->logfile && enc->stats_out) {
+ fprintf(ost->logfile, "%s", enc->stats_out);
+ }
+ }
+ }
+ ost->sync_opts++;
+ /*
+ * For video, number of frames in == number of packets out.
+ * But there may be reordering, so we can't throw away frames on encoder
+ * flush, we need to limit them here, before they go into encoder.
+ */
+ ost->frame_number++;
+
+ if (vstats_filename && frame_size)
+ do_video_stats(ost, frame_size);
+ }
+
+ if (!ost->last_frame)
+ ost->last_frame = av_frame_alloc();
+ av_frame_unref(ost->last_frame);
+ if (next_picture && ost->last_frame)
+ av_frame_ref(ost->last_frame, next_picture);
+ else
+ av_frame_free(&ost->last_frame);
+
+ return;
+error:
+ av_log(NULL, AV_LOG_FATAL, "Video encoding failed\n");
+ exit_program(1);
+}
+
+static double psnr(double d)
+{
+ return -10.0 * log10(d);
+}
+
+static void do_video_stats(OutputStream *ost, int frame_size)
+{
+ AVCodecContext *enc;
+ int frame_number;
+ double ti1, bitrate, avg_bitrate;
+
+ /* this is executed just the first time do_video_stats is called */
+ if (!vstats_file) {
+ vstats_file = fopen(vstats_filename, "w");
+ if (!vstats_file) {
+ perror("fopen");
+ exit_program(1);
+ }
+ }
+
+ enc = ost->enc_ctx;
+ if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
+ frame_number = ost->st->nb_frames;
+ if (vstats_version <= 1) {
+ fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,
+ ost->quality / (float)FF_QP2LAMBDA);
+ } else {
+ fprintf(vstats_file, "out= %2d st= %2d frame= %5d q= %2.1f ", ost->file_index, ost->index, frame_number,
+ ost->quality / (float)FF_QP2LAMBDA);
+ }
+
+ if (ost->error[0]>=0 && (enc->flags & AV_CODEC_FLAG_PSNR))
+ fprintf(vstats_file, "PSNR= %6.2f ", psnr(ost->error[0] / (enc->width * enc->height * 255.0 * 255.0)));
+
+ fprintf(vstats_file,"f_size= %6d ", frame_size);
+ /* compute pts value */
+ ti1 = av_stream_get_end_pts(ost->st) * av_q2d(ost->st->time_base);
+ if (ti1 < 0.01)
+ ti1 = 0.01;
+
+ bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0;
+ avg_bitrate = (double)(ost->data_size * 8) / ti1 / 1000.0;
+ fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
+ (double)ost->data_size / 1024, ti1, bitrate, avg_bitrate);
+ fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(ost->pict_type));
+ }
+}
+
+static int init_output_stream(OutputStream *ost, char *error, int error_len);
+
+static void finish_output_stream(OutputStream *ost)
+{
+ OutputFile *of = output_files[ost->file_index];
+ int i;
+
+ ost->finished = ENCODER_FINISHED | MUXER_FINISHED;
+
+ if (of->shortest) {
+ for (i = 0; i < of->ctx->nb_streams; i++)
+ output_streams[of->ost_index + i]->finished = ENCODER_FINISHED | MUXER_FINISHED;
+ }
+}
+
+/**
+ * Get and encode new output from any of the filtergraphs, without causing
+ * activity.
+ *
+ * @return 0 for success, <0 for severe errors
+ */
+static int reap_filters(int flush)
+{
+ AVFrame *filtered_frame = NULL;
+ int i;
+
+ /* Reap all buffers present in the buffer sinks */
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+ OutputFile *of = output_files[ost->file_index];
+ AVFilterContext *filter;
+ AVCodecContext *enc = ost->enc_ctx;
+ int ret = 0;
+
+ if (!ost->filter || !ost->filter->graph->graph)
+ continue;
+ filter = ost->filter->filter;
+
+ if (!ost->initialized) {
+ char error[1024] = "";
+ ret = init_output_stream(ost, error, sizeof(error));
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error initializing output stream %d:%d -- %s\n",
+ ost->file_index, ost->index, error);
+ exit_program(1);
+ }
+ }
+
+ if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
+ return AVERROR(ENOMEM);
+ }
+ filtered_frame = ost->filtered_frame;
+
+ while (1) {
+ double float_pts = AV_NOPTS_VALUE; // this is identical to filtered_frame.pts but with higher precision
+ ret = av_buffersink_get_frame_flags(filter, filtered_frame,
+ AV_BUFFERSINK_FLAG_NO_REQUEST);
+ if (ret < 0) {
+ if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
+ av_log(NULL, AV_LOG_WARNING,
+ "Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret));
+ } else if (flush && ret == AVERROR_EOF) {
+ if (av_buffersink_get_type(filter) == AVMEDIA_TYPE_VIDEO)
+ do_video_out(of, ost, NULL, AV_NOPTS_VALUE);
+ }
+ break;
+ }
+ if (ost->finished) {
+ av_frame_unref(filtered_frame);
+ continue;
+ }
+ if (filtered_frame->pts != AV_NOPTS_VALUE) {
+ int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
+ AVRational filter_tb = av_buffersink_get_time_base(filter);
+ AVRational tb = enc->time_base;
+ int extra_bits = av_clip(29 - av_log2(tb.den), 0, 16);
+
+ tb.den <<= extra_bits;
+ float_pts =
+ av_rescale_q(filtered_frame->pts, filter_tb, tb) -
+ av_rescale_q(start_time, AV_TIME_BASE_Q, tb);
+ float_pts /= 1 << extra_bits;
+ // avoid exact midoints to reduce the chance of rounding differences, this can be removed in case the fps code is changed to work with integers
+ float_pts += FFSIGN(float_pts) * 1.0 / (1<<17);
+
+ filtered_frame->pts =
+ av_rescale_q(filtered_frame->pts, filter_tb, enc->time_base) -
+ av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base);
+ }
+ //if (ost->source_index >= 0)
+ // *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold
+
+ switch (av_buffersink_get_type(filter)) {
+ case AVMEDIA_TYPE_VIDEO:
+ if (!ost->frame_aspect_ratio.num)
+ enc->sample_aspect_ratio = filtered_frame->sample_aspect_ratio;
+
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "filter -> pts:%s pts_time:%s exact:%f time_base:%d/%d\n",
+ av_ts2str(filtered_frame->pts), av_ts2timestr(filtered_frame->pts, &enc->time_base),
+ float_pts,
+ enc->time_base.num, enc->time_base.den);
+ }
+
+ do_video_out(of, ost, filtered_frame, float_pts);
+ break;
+ case AVMEDIA_TYPE_AUDIO:
+ if (!(enc->codec->capabilities & AV_CODEC_CAP_PARAM_CHANGE) &&
+ enc->channels != av_frame_get_channels(filtered_frame)) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Audio filter graph output is not normalized and encoder does not support parameter changes\n");
+ break;
+ }
+ do_audio_out(of, ost, filtered_frame);
+ break;
+ default:
+ // TODO support subtitle filters
+ av_assert0(0);
+ }
+
+ av_frame_unref(filtered_frame);
+ }
+ }
+
+ return 0;
+}
+
+static void print_final_stats(int64_t total_size)
+{
+ uint64_t video_size = 0, audio_size = 0, extra_size = 0, other_size = 0;
+ uint64_t subtitle_size = 0;
+ uint64_t data_size = 0;
+ float percent = -1.0;
+ int i, j;
+ int pass1_used = 1;
+
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+ switch (ost->enc_ctx->codec_type) {
+ case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break;
+ case AVMEDIA_TYPE_AUDIO: audio_size += ost->data_size; break;
+ case AVMEDIA_TYPE_SUBTITLE: subtitle_size += ost->data_size; break;
+ default: other_size += ost->data_size; break;
+ }
+ extra_size += ost->enc_ctx->extradata_size;
+ data_size += ost->data_size;
+ if ( (ost->enc_ctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2))
+ != AV_CODEC_FLAG_PASS1)
+ pass1_used = 0;
+ }
+
+ if (data_size && total_size>0 && total_size >= data_size)
+ percent = 100.0 * (total_size - data_size) / data_size;
+
+ av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB subtitle:%1.0fkB other streams:%1.0fkB global headers:%1.0fkB muxing overhead: ",
+ video_size / 1024.0,
+ audio_size / 1024.0,
+ subtitle_size / 1024.0,
+ other_size / 1024.0,
+ extra_size / 1024.0);
+ if (percent >= 0.0)
+ av_log(NULL, AV_LOG_INFO, "%f%%", percent);
+ else
+ av_log(NULL, AV_LOG_INFO, "unknown");
+ av_log(NULL, AV_LOG_INFO, "\n");
+
+ /* print verbose per-stream stats */
+ for (i = 0; i < nb_input_files; i++) {
+ InputFile *f = input_files[i];
+ uint64_t total_packets = 0, total_size = 0;
+
+ av_log(NULL, AV_LOG_VERBOSE, "Input file #%d (%s):\n",
+ i, f->ctx->filename);
+
+ for (j = 0; j < f->nb_streams; j++) {
+ InputStream *ist = input_streams[f->ist_index + j];
+ enum AVMediaType type = ist->dec_ctx->codec_type;
+
+ total_size += ist->data_size;
+ total_packets += ist->nb_packets;
+
+ av_log(NULL, AV_LOG_VERBOSE, " Input stream #%d:%d (%s): ",
+ i, j, media_type_string(type));
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets read (%"PRIu64" bytes); ",
+ ist->nb_packets, ist->data_size);
+
+ if (ist->decoding_needed) {
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" frames decoded",
+ ist->frames_decoded);
+ if (type == AVMEDIA_TYPE_AUDIO)
+ av_log(NULL, AV_LOG_VERBOSE, " (%"PRIu64" samples)", ist->samples_decoded);
+ av_log(NULL, AV_LOG_VERBOSE, "; ");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, "\n");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) demuxed\n",
+ total_packets, total_size);
+ }
+
+ for (i = 0; i < nb_output_files; i++) {
+ OutputFile *of = output_files[i];
+ uint64_t total_packets = 0, total_size = 0;
+
+ av_log(NULL, AV_LOG_VERBOSE, "Output file #%d (%s):\n",
+ i, of->ctx->filename);
+
+ for (j = 0; j < of->ctx->nb_streams; j++) {
+ OutputStream *ost = output_streams[of->ost_index + j];
+ enum AVMediaType type = ost->enc_ctx->codec_type;
+
+ total_size += ost->data_size;
+ total_packets += ost->packets_written;
+
+ av_log(NULL, AV_LOG_VERBOSE, " Output stream #%d:%d (%s): ",
+ i, j, media_type_string(type));
+ if (ost->encoding_needed) {
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" frames encoded",
+ ost->frames_encoded);
+ if (type == AVMEDIA_TYPE_AUDIO)
+ av_log(NULL, AV_LOG_VERBOSE, " (%"PRIu64" samples)", ost->samples_encoded);
+ av_log(NULL, AV_LOG_VERBOSE, "; ");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets muxed (%"PRIu64" bytes); ",
+ ost->packets_written, ost->data_size);
+
+ av_log(NULL, AV_LOG_VERBOSE, "\n");
+ }
+
+ av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) muxed\n",
+ total_packets, total_size);
+ }
+ if(video_size + data_size + audio_size + subtitle_size + extra_size == 0){
+ av_log(NULL, AV_LOG_WARNING, "Output file is empty, nothing was encoded ");
+ if (pass1_used) {
+ av_log(NULL, AV_LOG_WARNING, "\n");
+ } else {
+ av_log(NULL, AV_LOG_WARNING, "(check -ss / -t / -frames parameters if used)\n");
+ }
+ }
+}
+
+static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time)
+{
+ char buf[1024];
+ AVBPrint buf_script;
+ OutputStream *ost;
+ AVFormatContext *oc;
+ int64_t total_size;
+ AVCodecContext *enc;
+ int frame_number, vid, i;
+ double bitrate;
+ double speed;
+ int64_t pts = INT64_MIN + 1;
+ static int64_t last_time = -1;
+ static int qp_histogram[52];
+ int hours, mins, secs, us;
+ int ret;
+ float t;
+
+ if (!print_stats && !is_last_report && !progress_avio)
+ return;
+
+ if (!is_last_report) {
+ if (last_time == -1) {
+ last_time = cur_time;
+ return;
+ }
+ if ((cur_time - last_time) < 500000)
+ return;
+ last_time = cur_time;
+ }
+
+ t = (cur_time-timer_start) / 1000000.0;
+
+
+ oc = output_files[0]->ctx;
+
+ total_size = avio_size(oc->pb);
+ if (total_size <= 0) // FIXME improve avio_size() so it works with non seekable output too
+ total_size = avio_tell(oc->pb);
+
+ buf[0] = '\0';
+ vid = 0;
+ av_bprint_init(&buf_script, 0, 1);
+ for (i = 0; i < nb_output_streams; i++) {
+ float q = -1;
+ ost = output_streams[i];
+ enc = ost->enc_ctx;
+ if (!ost->stream_copy)
+ q = ost->quality / (float) FF_QP2LAMBDA;
+
+ if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
+ av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n",
+ ost->file_index, ost->index, q);
+ }
+ if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
+ float fps;
+
+ frame_number = ost->frame_number;
+ fps = t > 1 ? frame_number / t : 0;
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d fps=%3.*f q=%3.1f ",
+ frame_number, fps < 9.95, fps, q);
+ av_bprintf(&buf_script, "frame=%d\n", frame_number);
+ av_bprintf(&buf_script, "fps=%.1f\n", fps);
+ av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n",
+ ost->file_index, ost->index, q);
+ if (is_last_report)
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L");
+ if (qp_hist) {
+ int j;
+ int qp = lrintf(q);
+ if (qp >= 0 && qp < FF_ARRAY_ELEMS(qp_histogram))
+ qp_histogram[qp]++;
+ for (j = 0; j < 32; j++)
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", av_log2(qp_histogram[j] + 1));
+ }
+
+ if ((enc->flags & AV_CODEC_FLAG_PSNR) && (ost->pict_type != AV_PICTURE_TYPE_NONE || is_last_report)) {
+ int j;
+ double error, error_sum = 0;
+ double scale, scale_sum = 0;
+ double p;
+ char type[3] = { 'Y','U','V' };
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "PSNR=");
+ for (j = 0; j < 3; j++) {
+ if (is_last_report) {
+ error = enc->error[j];
+ scale = enc->width * enc->height * 255.0 * 255.0 * frame_number;
+ } else {
+ error = ost->error[j];
+ scale = enc->width * enc->height * 255.0 * 255.0;
+ }
+ if (j)
+ scale /= 4;
+ error_sum += error;
+ scale_sum += scale;
+ p = psnr(error / scale);
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%c:%2.2f ", type[j], p);
+ av_bprintf(&buf_script, "stream_%d_%d_psnr_%c=%2.2f\n",
+ ost->file_index, ost->index, type[j] | 32, p);
+ }
+ p = psnr(error_sum / scale_sum);
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "*:%2.2f ", psnr(error_sum / scale_sum));
+ av_bprintf(&buf_script, "stream_%d_%d_psnr_all=%2.2f\n",
+ ost->file_index, ost->index, p);
+ }
+ vid = 1;
+ }
+ /* compute min output value */
+ if (av_stream_get_end_pts(ost->st) != AV_NOPTS_VALUE)
+ pts = FFMAX(pts, av_rescale_q(av_stream_get_end_pts(ost->st),
+ ost->st->time_base, AV_TIME_BASE_Q));
+ if (is_last_report)
+ nb_frames_drop += ost->last_dropped;
+ }
+
+ secs = FFABS(pts) / AV_TIME_BASE;
+ us = FFABS(pts) % AV_TIME_BASE;
+ mins = secs / 60;
+ secs %= 60;
+ hours = mins / 60;
+ mins %= 60;
+
+ bitrate = pts && total_size >= 0 ? total_size * 8 / (pts / 1000.0) : -1;
+ speed = t != 0.0 ? (double)pts / AV_TIME_BASE / t : -1;
+
+ if (total_size < 0) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
+ "size=N/A time=");
+ else snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
+ "size=%8.0fkB time=", total_size / 1024.0);
+ if (pts < 0)
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "-");
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
+ "%02d:%02d:%02d.%02d ", hours, mins, secs,
+ (100 * us) / AV_TIME_BASE);
+
+ if (bitrate < 0) {
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),"bitrate=N/A");
+ av_bprintf(&buf_script, "bitrate=N/A\n");
+ }else{
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),"bitrate=%6.1fkbits/s", bitrate);
+ av_bprintf(&buf_script, "bitrate=%6.1fkbits/s\n", bitrate);
+ }
+
+ if (total_size < 0) av_bprintf(&buf_script, "total_size=N/A\n");
+ else av_bprintf(&buf_script, "total_size=%"PRId64"\n", total_size);
+ av_bprintf(&buf_script, "out_time_ms=%"PRId64"\n", pts);
+ av_bprintf(&buf_script, "out_time=%02d:%02d:%02d.%06d\n",
+ hours, mins, secs, us);
+
+ if (nb_frames_dup || nb_frames_drop)
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
+ nb_frames_dup, nb_frames_drop);
+ av_bprintf(&buf_script, "dup_frames=%d\n", nb_frames_dup);
+ av_bprintf(&buf_script, "drop_frames=%d\n", nb_frames_drop);
+
+ if (speed < 0) {
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf)," speed=N/A");
+ av_bprintf(&buf_script, "speed=N/A\n");
+ } else {
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf)," speed=%4.3gx", speed);
+ av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
+ }
+
+ if (print_stats || is_last_report) {
+ const char end = is_last_report ? '\n' : '\r';
+ if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
+ fprintf(stderr, "%s %c", buf, end);
+ } else
+ av_log(NULL, AV_LOG_INFO, "%s %c", buf, end);
+
+ fflush(stderr);
+ }
+
+ if (progress_avio) {
+ av_bprintf(&buf_script, "progress=%s\n",
+ is_last_report ? "end" : "continue");
+ avio_write(progress_avio, buf_script.str,
+ FFMIN(buf_script.len, buf_script.size - 1));
+ avio_flush(progress_avio);
+ av_bprint_finalize(&buf_script, NULL);
+ if (is_last_report) {
+ if ((ret = avio_closep(&progress_avio)) < 0)
+ av_log(NULL, AV_LOG_ERROR,
+ "Error closing progress log, loss of information possible: %s\n", av_err2str(ret));
+ }
+ }
+
+ if (is_last_report)
+ print_final_stats(total_size);
+}
+
+static void flush_encoders(void)
+{
+ int i, ret;
+
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+ AVCodecContext *enc = ost->enc_ctx;
+ OutputFile *of = output_files[ost->file_index];
+
+ if (!ost->encoding_needed)
+ continue;
+
+ // Try to enable encoding with no input frames.
+ // Maybe we should just let encoding fail instead.
+ if (!ost->initialized) {
+ FilterGraph *fg = ost->filter->graph;
+ char error[1024] = "";
+
+ av_log(NULL, AV_LOG_WARNING,
+ "Finishing stream %d:%d without any data written to it.\n",
+ ost->file_index, ost->st->index);
+
+ if (ost->filter && !fg->graph) {
+ int x;
+ for (x = 0; x < fg->nb_inputs; x++) {
+ InputFilter *ifilter = fg->inputs[x];
+ if (ifilter->format < 0) {
+ AVCodecParameters *par = ifilter->ist->st->codecpar;
+ // We never got any input. Set a fake format, which will
+ // come from libavformat.
+ ifilter->format = par->format;
+ ifilter->sample_rate = par->sample_rate;
+ ifilter->channels = par->channels;
+ ifilter->channel_layout = par->channel_layout;
+ ifilter->width = par->width;
+ ifilter->height = par->height;
+ ifilter->sample_aspect_ratio = par->sample_aspect_ratio;
+ }
+ }
+
+ if (!ifilter_has_all_input_formats(fg))
+ continue;
+
+ ret = configure_filtergraph(fg);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error configuring filter graph\n");
+ exit_program(1);
+ }
+
+ finish_output_stream(ost);
+ }
+
+ ret = init_output_stream(ost, error, sizeof(error));
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error initializing output stream %d:%d -- %s\n",
+ ost->file_index, ost->index, error);
+ exit_program(1);
+ }
+ }
+
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <= 1)
+ continue;
+#if FF_API_LAVF_FMT_RAWPICTURE
+ if (enc->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE) && enc->codec->id == AV_CODEC_ID_RAWVIDEO)
+ continue;
+#endif
+
+ if (enc->codec_type != AVMEDIA_TYPE_VIDEO && enc->codec_type != AVMEDIA_TYPE_AUDIO)
+ continue;
+
+ avcodec_send_frame(enc, NULL);
+
+ for (;;) {
+ const char *desc = NULL;
+ AVPacket pkt;
+ int pkt_size;
+
+ switch (enc->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ desc = "audio";
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ desc = "video";
+ break;
+ default:
+ av_assert0(0);
+ }
+
+ av_init_packet(&pkt);
+ pkt.data = NULL;
+ pkt.size = 0;
+
+ update_benchmark(NULL);
+ ret = avcodec_receive_packet(enc, &pkt);
+ update_benchmark("flush_%s %d.%d", desc, ost->file_index, ost->index);
+ if (ret < 0 && ret != AVERROR_EOF) {
+ av_log(NULL, AV_LOG_FATAL, "%s encoding failed: %s\n",
+ desc,
+ av_err2str(ret));
+ exit_program(1);
+ }
+ if (ost->logfile && enc->stats_out) {
+ fprintf(ost->logfile, "%s", enc->stats_out);
+ }
+ if (ret == AVERROR_EOF) {
+ break;
+ }
+ if (ost->finished & MUXER_FINISHED) {
+ av_packet_unref(&pkt);
+ continue;
+ }
+ av_packet_rescale_ts(&pkt, enc->time_base, ost->mux_timebase);
+ pkt_size = pkt.size;
+ output_packet(of, &pkt, ost);
+ if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) {
+ do_video_stats(ost, pkt_size);
+ }
+ }
+ }
+}
+
+/*
+ * Check whether a packet from ist should be written into ost at this time
+ */
+static int check_output_constraints(InputStream *ist, OutputStream *ost)
+{
+ OutputFile *of = output_files[ost->file_index];
+ int ist_index = input_files[ist->file_index]->ist_index + ist->st->index;
+
+ if (ost->source_index != ist_index)
+ return 0;
+
+ if (ost->finished)
+ return 0;
+
+ if (of->start_time != AV_NOPTS_VALUE && ist->pts < of->start_time)
+ return 0;
+
+ return 1;
+}
+
+static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *pkt)
+{
+ OutputFile *of = output_files[ost->file_index];
+ InputFile *f = input_files [ist->file_index];
+ int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
+ int64_t ost_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, ost->mux_timebase);
+ AVPicture pict;
+ AVPacket opkt;
+
+ av_init_packet(&opkt);
+
+ if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
+ !ost->copy_initial_nonkeyframes)
+ return;
+
+ if (!ost->frame_number && !ost->copy_prior_start) {
+ int64_t comp_start = start_time;
+ if (copy_ts && f->start_time != AV_NOPTS_VALUE)
+ comp_start = FFMAX(start_time, f->start_time + f->ts_offset);
+ if (pkt->pts == AV_NOPTS_VALUE ?
+ ist->pts < comp_start :
+ pkt->pts < av_rescale_q(comp_start, AV_TIME_BASE_Q, ist->st->time_base))
+ return;
+ }
+
+ if (of->recording_time != INT64_MAX &&
+ ist->pts >= of->recording_time + start_time) {
+ close_output_stream(ost);
+ return;
+ }
+
+ if (f->recording_time != INT64_MAX) {
+ start_time = f->ctx->start_time;
+ if (f->start_time != AV_NOPTS_VALUE && copy_ts)
+ start_time += f->start_time;
+ if (ist->pts >= f->recording_time + start_time) {
+ close_output_stream(ost);
+ return;
+ }
+ }
+
+ /* force the input stream PTS */
+ if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
+ ost->sync_opts++;
+
+ if (pkt->pts != AV_NOPTS_VALUE)
+ opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, ost->mux_timebase) - ost_tb_start_time;
+ else
+ opkt.pts = AV_NOPTS_VALUE;
+
+ if (pkt->dts == AV_NOPTS_VALUE)
+ opkt.dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ost->mux_timebase);
+ else
+ opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->mux_timebase);
+ opkt.dts -= ost_tb_start_time;
+
+ if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && pkt->dts != AV_NOPTS_VALUE) {
+ int duration = av_get_audio_frame_duration(ist->dec_ctx, pkt->size);
+ if(!duration)
+ duration = ist->dec_ctx->frame_size;
+ opkt.dts = opkt.pts = av_rescale_delta(ist->st->time_base, pkt->dts,
+ (AVRational){1, ist->dec_ctx->sample_rate}, duration, &ist->filter_in_rescale_delta_last,
+ ost->mux_timebase) - ost_tb_start_time;
+ }
+
+ opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->mux_timebase);
+
+ opkt.flags = pkt->flags;
+ // FIXME remove the following 2 lines they shall be replaced by the bitstream filters
+ if ( ost->st->codecpar->codec_id != AV_CODEC_ID_H264
+ && ost->st->codecpar->codec_id != AV_CODEC_ID_MPEG1VIDEO
+ && ost->st->codecpar->codec_id != AV_CODEC_ID_MPEG2VIDEO
+ && ost->st->codecpar->codec_id != AV_CODEC_ID_VC1
+ ) {
+ int ret = av_parser_change(ost->parser, ost->parser_avctx,
+ &opkt.data, &opkt.size,
+ pkt->data, pkt->size,
+ pkt->flags & AV_PKT_FLAG_KEY);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "av_parser_change failed: %s\n",
+ av_err2str(ret));
+ exit_program(1);
+ }
+ if (ret) {
+ opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0);
+ if (!opkt.buf)
+ exit_program(1);
+ }
+ } else {
+ opkt.data = pkt->data;
+ opkt.size = pkt->size;
+ }
+ av_copy_packet_side_data(&opkt, pkt);
+
+#if FF_API_LAVF_FMT_RAWPICTURE
+ if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
+ ost->st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO &&
+ (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
+ /* store AVPicture in AVPacket, as expected by the output format */
+ int ret = avpicture_fill(&pict, opkt.data, ost->st->codecpar->format, ost->st->codecpar->width, ost->st->codecpar->height);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "avpicture_fill failed: %s\n",
+ av_err2str(ret));
+ exit_program(1);
+ }
+ opkt.data = (uint8_t *)&pict;
+ opkt.size = sizeof(AVPicture);
+ opkt.flags |= AV_PKT_FLAG_KEY;
+ }
+#endif
+
+ output_packet(of, &opkt, ost);
+}
+
+int guess_input_channel_layout(InputStream *ist)
+{
+ AVCodecContext *dec = ist->dec_ctx;
+
+ if (!dec->channel_layout) {
+ char layout_name[256];
+
+ if (dec->channels > ist->guess_layout_max)
+ return 0;
+ dec->channel_layout = av_get_default_channel_layout(dec->channels);
+ if (!dec->channel_layout)
+ return 0;
+ av_get_channel_layout_string(layout_name, sizeof(layout_name),
+ dec->channels, dec->channel_layout);
+ av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Input Stream "
+ "#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name);
+ }
+ return 1;
+}
+
+static void check_decode_result(InputStream *ist, int *got_output, int ret)
+{
+ if (*got_output || ret<0)
+ decode_error_stat[ret<0] ++;
+
+ if (ret < 0 && exit_on_error)
+ exit_program(1);
+
+ if (exit_on_error && *got_output && ist) {
+ if (av_frame_get_decode_error_flags(ist->decoded_frame) || (ist->decoded_frame->flags & AV_FRAME_FLAG_CORRUPT)) {
+ av_log(NULL, AV_LOG_FATAL, "%s: corrupt decoded frame in stream %d\n", input_files[ist->file_index]->ctx->filename, ist->st->index);
+ exit_program(1);
+ }
+ }
+}
+
+// Filters can be configured only if the formats of all inputs are known.
+static int ifilter_has_all_input_formats(FilterGraph *fg)
+{
+ int i;
+ for (i = 0; i < fg->nb_inputs; i++) {
+ if (fg->inputs[i]->format < 0 && (fg->inputs[i]->type == AVMEDIA_TYPE_AUDIO ||
+ fg->inputs[i]->type == AVMEDIA_TYPE_VIDEO))
+ return 0;
+ }
+ return 1;
+}
+
+static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
+{
+ FilterGraph *fg = ifilter->graph;
+ int need_reinit, ret, i;
+
+ /* determine if the parameters for this input changed */
+ need_reinit = ifilter->format != frame->format;
+ if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
+ (ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data))
+ need_reinit = 1;
+
+ switch (ifilter->ist->st->codecpar->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ need_reinit |= ifilter->sample_rate != frame->sample_rate ||
+ ifilter->channels != frame->channels ||
+ ifilter->channel_layout != frame->channel_layout;
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ need_reinit |= ifilter->width != frame->width ||
+ ifilter->height != frame->height;
+ break;
+ }
+
+ if (need_reinit) {
+ ret = ifilter_parameters_from_frame(ifilter, frame);
+ if (ret < 0)
+ return ret;
+ }
+
+ /* (re)init the graph if possible, otherwise buffer the frame and return */
+ if (need_reinit || !fg->graph) {
+ for (i = 0; i < fg->nb_inputs; i++) {
+ if (!ifilter_has_all_input_formats(fg)) {
+ AVFrame *tmp = av_frame_clone(frame);
+ if (!tmp)
+ return AVERROR(ENOMEM);
+ av_frame_unref(frame);
+
+ if (!av_fifo_space(ifilter->frame_queue)) {
+ ret = av_fifo_realloc2(ifilter->frame_queue, 2 * av_fifo_size(ifilter->frame_queue));
+ if (ret < 0) {
+ av_frame_free(&tmp);
+ return ret;
+ }
+ }
+ av_fifo_generic_write(ifilter->frame_queue, &tmp, sizeof(tmp), NULL);
+ return 0;
+ }
+ }
+
+ ret = reap_filters(1);
+ if (ret < 0 && ret != AVERROR_EOF) {
+ char errbuf[128];
+ av_strerror(ret, errbuf, sizeof(errbuf));
+
+ av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", errbuf);
+ return ret;
+ }
+
+ ret = configure_filtergraph(fg);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error reinitializing filters!\n");
+ return ret;
+ }
+ }
+
+ ret = av_buffersrc_add_frame_flags(ifilter->filter, frame, AV_BUFFERSRC_FLAG_PUSH);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error while filtering\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int ifilter_send_eof(InputFilter *ifilter)
+{
+ int i, j, ret;
+
+ ifilter->eof = 1;
+
+ if (ifilter->filter) {
+ ret = av_buffersrc_add_frame_flags(ifilter->filter, NULL, AV_BUFFERSRC_FLAG_PUSH);
+ if (ret < 0)
+ return ret;
+ } else {
+ // the filtergraph was never configured
+ FilterGraph *fg = ifilter->graph;
+ for (i = 0; i < fg->nb_inputs; i++)
+ if (!fg->inputs[i]->eof)
+ break;
+ if (i == fg->nb_inputs) {
+ // All the input streams have finished without the filtergraph
+ // ever being configured.
+ // Mark the output streams as finished.
+ for (j = 0; j < fg->nb_outputs; j++)
+ finish_output_stream(fg->outputs[j]->ost);
+ }
+ }
+
+ return 0;
+}
+
+// This does not quite work like avcodec_decode_audio4/avcodec_decode_video2.
+// There is the following difference: if you got a frame, you must call
+// it again with pkt=NULL. pkt==NULL is treated differently from pkt.size==0
+// (pkt==NULL means get more output, pkt.size==0 is a flush/drain packet)
+static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
+{
+ int ret;
+
+ *got_frame = 0;
+
+ if (pkt) {
+ ret = avcodec_send_packet(avctx, pkt);
+ // In particular, we don't expect AVERROR(EAGAIN), because we read all
+ // decoded frames with avcodec_receive_frame() until done.
+ if (ret < 0 && ret != AVERROR_EOF)
+ return ret;
+ }
+
+ ret = avcodec_receive_frame(avctx, frame);
+ if (ret < 0 && ret != AVERROR(EAGAIN))
+ return ret;
+ if (ret >= 0)
+ *got_frame = 1;
+
+ return 0;
+}
+
+static int send_frame_to_filters(InputStream *ist, AVFrame *decoded_frame)
+{
+ int i, ret;
+ AVFrame *f;
+
+ av_assert1(ist->nb_filters > 0); /* ensure ret is initialized */
+ for (i = 0; i < ist->nb_filters; i++) {
+ if (i < ist->nb_filters - 1) {
+ f = ist->filter_frame;
+ ret = av_frame_ref(f, decoded_frame);
+ if (ret < 0)
+ break;
+ } else
+ f = decoded_frame;
+ ret = ifilter_send_frame(ist->filters[i], f);
+ if (ret == AVERROR_EOF)
+ ret = 0; /* ignore */
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Failed to inject frame into filter network: %s\n", av_err2str(ret));
+ break;
+ }
+ }
+ return ret;
+}
+
+static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
+ int *decode_failed)
+{
+ AVFrame *decoded_frame;
+ AVCodecContext *avctx = ist->dec_ctx;
+ int ret, err = 0;
+ AVRational decoded_frame_tb;
+
+ if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
+ return AVERROR(ENOMEM);
+ if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
+ return AVERROR(ENOMEM);
+ decoded_frame = ist->decoded_frame;
+
+ update_benchmark(NULL);
+ ret = decode(avctx, decoded_frame, got_output, pkt);
+ update_benchmark("decode_audio %d.%d", ist->file_index, ist->st->index);
+ if (ret < 0)
+ *decode_failed = 1;
+
+ if (ret >= 0 && avctx->sample_rate <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Sample rate %d invalid\n", avctx->sample_rate);
+ ret = AVERROR_INVALIDDATA;
+ }
+
+ if (ret != AVERROR_EOF)
+ check_decode_result(ist, got_output, ret);
+
+ if (!*got_output || ret < 0)
+ return ret;
+
+ ist->samples_decoded += decoded_frame->nb_samples;
+ ist->frames_decoded++;
+
+#if 1
+ /* increment next_dts to use for the case where the input stream does not
+ have timestamps or there are multiple frames in the packet */
+ ist->next_pts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
+ avctx->sample_rate;
+ ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
+ avctx->sample_rate;
+#endif
+
+ if (decoded_frame->pts != AV_NOPTS_VALUE) {
+ decoded_frame_tb = ist->st->time_base;
+ } else if (pkt && pkt->pts != AV_NOPTS_VALUE) {
+ decoded_frame->pts = pkt->pts;
+ decoded_frame_tb = ist->st->time_base;
+ }else {
+ decoded_frame->pts = ist->dts;
+ decoded_frame_tb = AV_TIME_BASE_Q;
+ }
+ if (decoded_frame->pts != AV_NOPTS_VALUE)
+ decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts,
+ (AVRational){1, avctx->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last,
+ (AVRational){1, avctx->sample_rate});
+ ist->nb_samples = decoded_frame->nb_samples;
+ err = send_frame_to_filters(ist, decoded_frame);
+
+ av_frame_unref(ist->filter_frame);
+ av_frame_unref(decoded_frame);
+ return err < 0 ? err : ret;
+}
+
+static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int eof,
+ int *decode_failed)
+{
+ AVFrame *decoded_frame;
+ int i, ret = 0, err = 0;
+ int64_t best_effort_timestamp;
+ int64_t dts = AV_NOPTS_VALUE;
+ AVPacket avpkt;
+
+ // With fate-indeo3-2, we're getting 0-sized packets before EOF for some
+ // reason. This seems like a semi-critical bug. Don't trigger EOF, and
+ // skip the packet.
+ if (!eof && pkt && pkt->size == 0)
+ return 0;
+
+ if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
+ return AVERROR(ENOMEM);
+ if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
+ return AVERROR(ENOMEM);
+ decoded_frame = ist->decoded_frame;
+ if (ist->dts != AV_NOPTS_VALUE)
+ dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ist->st->time_base);
+ if (pkt) {
+ avpkt = *pkt;
+ avpkt.dts = dts; // ffmpeg.c probably shouldn't do this
+ }
+
+ // The old code used to set dts on the drain packet, which does not work
+ // with the new API anymore.
+ if (eof) {
+ void *new = av_realloc_array(ist->dts_buffer, ist->nb_dts_buffer + 1, sizeof(ist->dts_buffer[0]));
+ if (!new)
+ return AVERROR(ENOMEM);
+ ist->dts_buffer = new;
+ ist->dts_buffer[ist->nb_dts_buffer++] = dts;
+ }
+
+ update_benchmark(NULL);
+ ret = decode(ist->dec_ctx, decoded_frame, got_output, pkt ? &avpkt : NULL);
+ update_benchmark("decode_video %d.%d", ist->file_index, ist->st->index);
+ if (ret < 0)
+ *decode_failed = 1;
+
+ // The following line may be required in some cases where there is no parser
+ // or the parser does not has_b_frames correctly
+ if (ist->st->codecpar->video_delay < ist->dec_ctx->has_b_frames) {
+ if (ist->dec_ctx->codec_id == AV_CODEC_ID_H264) {
+ ist->st->codecpar->video_delay = ist->dec_ctx->has_b_frames;
+ } else
+ av_log(ist->dec_ctx, AV_LOG_WARNING,
+ "video_delay is larger in decoder than demuxer %d > %d.\n"
+ "If you want to help, upload a sample "
+ "of this file to ftp://upload.ffmpeg.org/incoming/ "
+ "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)\n",
+ ist->dec_ctx->has_b_frames,
+ ist->st->codecpar->video_delay);
+ }
+
+ if (ret != AVERROR_EOF)
+ check_decode_result(ist, got_output, ret);
+
+ if (*got_output && ret >= 0) {
+ if (ist->dec_ctx->width != decoded_frame->width ||
+ ist->dec_ctx->height != decoded_frame->height ||
+ ist->dec_ctx->pix_fmt != decoded_frame->format) {
+ av_log(NULL, AV_LOG_DEBUG, "Frame parameters mismatch context %d,%d,%d != %d,%d,%d\n",
+ decoded_frame->width,
+ decoded_frame->height,
+ decoded_frame->format,
+ ist->dec_ctx->width,
+ ist->dec_ctx->height,
+ ist->dec_ctx->pix_fmt);
+ }
+ }
+
+ if (!*got_output || ret < 0)
+ return ret;
+
+ if(ist->top_field_first>=0)
+ decoded_frame->top_field_first = ist->top_field_first;
+
+ ist->frames_decoded++;
+
+ if (ist->hwaccel_retrieve_data && decoded_frame->format == ist->hwaccel_pix_fmt) {
+ err = ist->hwaccel_retrieve_data(ist->dec_ctx, decoded_frame);
+ if (err < 0)
+ goto fail;
+ }
+ ist->hwaccel_retrieved_pix_fmt = decoded_frame->format;
+
+ best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame);
+
+ if (ist->framerate.num)
+ best_effort_timestamp = ist->cfr_next_pts++;
+
+ if (eof && best_effort_timestamp == AV_NOPTS_VALUE && ist->nb_dts_buffer > 0) {
+ best_effort_timestamp = ist->dts_buffer[0];
+
+ for (i = 0; i < ist->nb_dts_buffer - 1; i++)
+ ist->dts_buffer[i] = ist->dts_buffer[i + 1];
+ ist->nb_dts_buffer--;
+ }
+
+ if(best_effort_timestamp != AV_NOPTS_VALUE) {
+ int64_t ts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q);
+
+ if (ts != AV_NOPTS_VALUE)
+ ist->next_pts = ist->pts = ts;
+ }
+
+ if (debug_ts) {
+ av_log(NULL, AV_LOG_INFO, "decoder -> ist_index:%d type:video "
+ "frame_pts:%s frame_pts_time:%s best_effort_ts:%"PRId64" best_effort_ts_time:%s keyframe:%d frame_type:%d time_base:%d/%d\n",
+ ist->st->index, av_ts2str(decoded_frame->pts),
+ av_ts2timestr(decoded_frame->pts, &ist->st->time_base),
+ best_effort_timestamp,
+ av_ts2timestr(best_effort_timestamp, &ist->st->time_base),
+ decoded_frame->key_frame, decoded_frame->pict_type,
+ ist->st->time_base.num, ist->st->time_base.den);
+ }
+
+ if (ist->st->sample_aspect_ratio.num)
+ decoded_frame->sample_aspect_ratio = ist->st->sample_aspect_ratio;
+
+ err = send_frame_to_filters(ist, decoded_frame);
+
+fail:
+ av_frame_unref(ist->filter_frame);
+ av_frame_unref(decoded_frame);
+ return err < 0 ? err : ret;
+}
+
+static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output,
+ int *decode_failed)
+{
+ AVSubtitle subtitle;
+ int free_sub = 1;
+ int i, ret = avcodec_decode_subtitle2(ist->dec_ctx,
+ &subtitle, got_output, pkt);
+
+ check_decode_result(NULL, got_output, ret);
+
+ if (ret < 0 || !*got_output) {
+ *decode_failed = 1;
+ if (!pkt->size)
+ sub2video_flush(ist);
+ return ret;
+ }
+
+ if (ist->fix_sub_duration) {
+ int end = 1;
+ if (ist->prev_sub.got_output) {
+ end = av_rescale(subtitle.pts - ist->prev_sub.subtitle.pts,
+ 1000, AV_TIME_BASE);
+ if (end < ist->prev_sub.subtitle.end_display_time) {
+ av_log(ist->dec_ctx, AV_LOG_DEBUG,
+ "Subtitle duration reduced from %"PRId32" to %d%s\n",
+ ist->prev_sub.subtitle.end_display_time, end,
+ end <= 0 ? ", dropping it" : "");
+ ist->prev_sub.subtitle.end_display_time = end;
+ }
+ }
+ FFSWAP(int, *got_output, ist->prev_sub.got_output);
+ FFSWAP(int, ret, ist->prev_sub.ret);
+ FFSWAP(AVSubtitle, subtitle, ist->prev_sub.subtitle);
+ if (end <= 0)
+ goto out;
+ }
+
+ if (!*got_output)
+ return ret;
+
+ if (ist->sub2video.frame) {
+ sub2video_update(ist, &subtitle);
+ } else if (ist->nb_filters) {
+ if (!ist->sub2video.sub_queue)
+ ist->sub2video.sub_queue = av_fifo_alloc(8 * sizeof(AVSubtitle));
+ if (!ist->sub2video.sub_queue)
+ exit_program(1);
+ if (!av_fifo_space(ist->sub2video.sub_queue)) {
+ ret = av_fifo_realloc2(ist->sub2video.sub_queue, 2 * av_fifo_size(ist->sub2video.sub_queue));
+ if (ret < 0)
+ exit_program(1);
+ }
+ av_fifo_generic_write(ist->sub2video.sub_queue, &subtitle, sizeof(subtitle), NULL);
+ free_sub = 0;
+ }
+
+ if (!subtitle.num_rects)
+ goto out;
+
+ ist->frames_decoded++;
+
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+
+ if (!check_output_constraints(ist, ost) || !ost->encoding_needed
+ || ost->enc->type != AVMEDIA_TYPE_SUBTITLE)
+ continue;
+
+ do_subtitle_out(output_files[ost->file_index], ost, &subtitle);
+ }
+
+out:
+ if (free_sub)
+ avsubtitle_free(&subtitle);
+ return ret;
+}
+
+static int send_filter_eof(InputStream *ist)
+{
+ int i, ret;
+ for (i = 0; i < ist->nb_filters; i++) {
+ ret = ifilter_send_eof(ist->filters[i]);
+ if (ret < 0)
+ return ret;
+ }
+ return 0;
+}
+
+/* pkt = NULL means EOF (needed to flush decoder buffers) */
+static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof)
+{
+ int ret = 0, i;
+ int repeating = 0;
+ int eof_reached = 0;
+
+ AVPacket avpkt;
+ if (!ist->saw_first_ts) {
+ ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
+ ist->pts = 0;
+ if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
+ ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q);
+ ist->pts = ist->dts; //unused but better to set it to a value thats not totally wrong
+ }
+ ist->saw_first_ts = 1;
+ }
+
+ if (ist->next_dts == AV_NOPTS_VALUE)
+ ist->next_dts = ist->dts;
+ if (ist->next_pts == AV_NOPTS_VALUE)
+ ist->next_pts = ist->pts;
+
+ if (!pkt) {
+ /* EOF handling */
+ av_init_packet(&avpkt);
+ avpkt.data = NULL;
+ avpkt.size = 0;
+ } else {
+ avpkt = *pkt;
+ }
+
+ if (pkt && pkt->dts != AV_NOPTS_VALUE) {
+ ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
+ if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed)
+ ist->next_pts = ist->pts = ist->dts;
+ }
+
+ // while we have more to decode or while the decoder did output something on EOF
+ while (ist->decoding_needed) {
+ int duration = 0;
+ int got_output = 0;
+ int decode_failed = 0;
+
+ ist->pts = ist->next_pts;
+ ist->dts = ist->next_dts;
+
+ switch (ist->dec_ctx->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ ret = decode_audio (ist, repeating ? NULL : &avpkt, &got_output,
+ &decode_failed);
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ ret = decode_video (ist, repeating ? NULL : &avpkt, &got_output, !pkt,
+ &decode_failed);
+ if (!repeating || !pkt || got_output) {
+ if (pkt && pkt->duration) {
+ duration = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
+ } else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) {
+ int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict+1 : ist->dec_ctx->ticks_per_frame;
+ duration = ((int64_t)AV_TIME_BASE *
+ ist->dec_ctx->framerate.den * ticks) /
+ ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame;
+ }
+
+ if(ist->dts != AV_NOPTS_VALUE && duration) {
+ ist->next_dts += duration;
+ }else
+ ist->next_dts = AV_NOPTS_VALUE;
+ }
+
+ if (got_output)
+ ist->next_pts += duration; //FIXME the duration is not correct in some cases
+ break;
+ case AVMEDIA_TYPE_SUBTITLE:
+ if (repeating)
+ break;
+ ret = transcode_subtitles(ist, &avpkt, &got_output, &decode_failed);
+ if (!pkt && ret >= 0)
+ ret = AVERROR_EOF;
+ break;
+ default:
+ return -1;
+ }
+
+ if (ret == AVERROR_EOF) {
+ eof_reached = 1;
+ break;
+ }
+
+ if (ret < 0) {
+ if (decode_failed) {
+ av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d: %s\n",
+ ist->file_index, ist->st->index, av_err2str(ret));
+ } else {
+ av_log(NULL, AV_LOG_FATAL, "Error while processing the decoded "
+ "data for stream #%d:%d\n", ist->file_index, ist->st->index);
+ }
+ if (!decode_failed || exit_on_error)
+ exit_program(1);
+ break;
+ }
+
+ if (got_output)
+ ist->got_output = 1;
+
+ if (!got_output)
+ break;
+
+ // During draining, we might get multiple output frames in this loop.
+ // ffmpeg.c does not drain the filter chain on configuration changes,
+ // which means if we send multiple frames at once to the filters, and
+ // one of those frames changes configuration, the buffered frames will
+ // be lost. This can upset certain FATE tests.
+ // Decode only 1 frame per call on EOF to appease these FATE tests.
+ // The ideal solution would be to rewrite decoding to use the new
+ // decoding API in a better way.
+ if (!pkt)
+ break;
+
+ repeating = 1;
+ }
+
+ /* after flushing, send an EOF on all the filter inputs attached to the stream */
+ /* except when looping we need to flush but not to send an EOF */
+ if (!pkt && ist->decoding_needed && eof_reached && !no_eof) {
+ int ret = send_filter_eof(ist);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Error marking filters as finished\n");
+ exit_program(1);
+ }
+ }
+
+ /* handle stream copy */
+ if (!ist->decoding_needed) {
+ ist->dts = ist->next_dts;
+ switch (ist->dec_ctx->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ ist->next_dts += ((int64_t)AV_TIME_BASE * ist->dec_ctx->frame_size) /
+ ist->dec_ctx->sample_rate;
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ if (ist->framerate.num) {
+ // TODO: Remove work-around for c99-to-c89 issue 7
+ AVRational time_base_q = AV_TIME_BASE_Q;
+ int64_t next_dts = av_rescale_q(ist->next_dts, time_base_q, av_inv_q(ist->framerate));
+ ist->next_dts = av_rescale_q(next_dts + 1, av_inv_q(ist->framerate), time_base_q);
+ } else if (pkt->duration) {
+ ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
+ } else if(ist->dec_ctx->framerate.num != 0) {
+ int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict + 1 : ist->dec_ctx->ticks_per_frame;
+ ist->next_dts += ((int64_t)AV_TIME_BASE *
+ ist->dec_ctx->framerate.den * ticks) /
+ ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame;
+ }
+ break;
+ }
+ ist->pts = ist->dts;
+ ist->next_pts = ist->next_dts;
+ }
+ for (i = 0; pkt && i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+
+ if (!check_output_constraints(ist, ost) || ost->encoding_needed)
+ continue;
+
+ do_streamcopy(ist, ost, pkt);
+ }
+
+ return !eof_reached;
+}
+
+static void print_sdp(void)
+{
+ char sdp[16384];
+ int i;
+ int j;
+ AVIOContext *sdp_pb;
+ AVFormatContext **avc;
+
+ for (i = 0; i < nb_output_files; i++) {
+ if (!output_files[i]->header_written)
+ return;
+ }
+
+ avc = av_malloc_array(nb_output_files, sizeof(*avc));
+ if (!avc)
+ exit_program(1);
+ for (i = 0, j = 0; i < nb_output_files; i++) {
+ if (!strcmp(output_files[i]->ctx->oformat->name, "rtp")) {
+ avc[j] = output_files[i]->ctx;
+ j++;
+ }
+ }
+
+ if (!j)
+ goto fail;
+
+ av_sdp_create(avc, j, sdp, sizeof(sdp));
+
+ if (!sdp_filename) {
+ printf("SDP:\n%s\n", sdp);
+ fflush(stdout);
+ } else {
+ if (avio_open2(&sdp_pb, sdp_filename, AVIO_FLAG_WRITE, &int_cb, NULL) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Failed to open sdp file '%s'\n", sdp_filename);
+ } else {
+ avio_printf(sdp_pb, "SDP:\n%s", sdp);
+ avio_closep(&sdp_pb);
+ av_freep(&sdp_filename);
+ }
+ }
+
+fail:
+ av_freep(&avc);
+}
+
+static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt)
+{
+ int i;
+ for (i = 0; hwaccels[i].name; i++)
+ if (hwaccels[i].pix_fmt == pix_fmt)
+ return &hwaccels[i];
+ return NULL;
+}
+
+static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
+{
+ InputStream *ist = s->opaque;
+ const enum AVPixelFormat *p;
+ int ret;
+
+ for (p = pix_fmts; *p != -1; p++) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
+ const HWAccel *hwaccel;
+
+ if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
+ break;
+
+ hwaccel = get_hwaccel(*p);
+ if (!hwaccel ||
+ (ist->active_hwaccel_id && ist->active_hwaccel_id != hwaccel->id) ||
+ (ist->hwaccel_id != HWACCEL_AUTO && ist->hwaccel_id != hwaccel->id))
+ continue;
+
+ ret = hwaccel->init(s);
+ if (ret < 0) {
+ if (ist->hwaccel_id == hwaccel->id) {
+ av_log(NULL, AV_LOG_FATAL,
+ "%s hwaccel requested for input stream #%d:%d, "
+ "but cannot be initialized.\n", hwaccel->name,
+ ist->file_index, ist->st->index);
+ return AV_PIX_FMT_NONE;
+ }
+ continue;
+ }
+
+ if (ist->hw_frames_ctx) {
+ s->hw_frames_ctx = av_buffer_ref(ist->hw_frames_ctx);
+ if (!s->hw_frames_ctx)
+ return AV_PIX_FMT_NONE;
+ }
+
+ ist->active_hwaccel_id = hwaccel->id;
+ ist->hwaccel_pix_fmt = *p;
+ break;
+ }
+
+ return *p;
+}
+
+static int get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
+{
+ InputStream *ist = s->opaque;
+
+ if (ist->hwaccel_get_buffer && frame->format == ist->hwaccel_pix_fmt)
+ return ist->hwaccel_get_buffer(s, frame, flags);
+
+ return avcodec_default_get_buffer2(s, frame, flags);
+}
+
+static int init_input_stream(int ist_index, char *error, int error_len)
+{
+ int ret;
+ InputStream *ist = input_streams[ist_index];
+
+ if (ist->decoding_needed) {
+ AVCodec *codec = ist->dec;
+ if (!codec) {
+ snprintf(error, error_len, "Decoder (codec %s) not found for input stream #%d:%d",
+ avcodec_get_name(ist->dec_ctx->codec_id), ist->file_index, ist->st->index);
+ return AVERROR(EINVAL);
+ }
+
+ ist->dec_ctx->opaque = ist;
+ ist->dec_ctx->get_format = get_format;
+ ist->dec_ctx->get_buffer2 = get_buffer;
+ ist->dec_ctx->thread_safe_callbacks = 1;
+
+ av_opt_set_int(ist->dec_ctx, "refcounted_frames", 1, 0);
+ if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE &&
+ (ist->decoding_needed & DECODING_FOR_OST)) {
+ av_dict_set(&ist->decoder_opts, "compute_edt", "1", AV_DICT_DONT_OVERWRITE);
+ if (ist->decoding_needed & DECODING_FOR_FILTER)
+ av_log(NULL, AV_LOG_WARNING, "Warning using DVB subtitles for filtering and output at the same time is not fully supported, also see -compute_edt [0|1]\n");
+ }
+
+ av_dict_set(&ist->decoder_opts, "sub_text_format", "ass", AV_DICT_DONT_OVERWRITE);
+
+ /* Useful for subtitles retiming by lavf (FIXME), skipping samples in
+ * audio, and video decoders such as cuvid or mediacodec */
+ av_codec_set_pkt_timebase(ist->dec_ctx, ist->st->time_base);
+
+ if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0))
+ av_dict_set(&ist->decoder_opts, "threads", "auto", 0);
+ if ((ret = avcodec_open2(ist->dec_ctx, codec, &ist->decoder_opts)) < 0) {
+ if (ret == AVERROR_EXPERIMENTAL)
+ abort_codec_experimental(codec, 0);
+
+ snprintf(error, error_len,
+ "Error while opening decoder for input stream "
+ "#%d:%d : %s",
+ ist->file_index, ist->st->index, av_err2str(ret));
+ return ret;
+ }
+ assert_avoptions(ist->decoder_opts);
+ }
+
+ ist->next_pts = AV_NOPTS_VALUE;
+ ist->next_dts = AV_NOPTS_VALUE;
+
+ return 0;
+}
+
+static InputStream *get_input_stream(OutputStream *ost)
+{
+ if (ost->source_index >= 0)
+ return input_streams[ost->source_index];
+ return NULL;
+}
+
+static int compare_int64(const void *a, const void *b)
+{
+ return FFDIFFSIGN(*(const int64_t *)a, *(const int64_t *)b);
+}
+
+/* open the muxer when all the streams are initialized */
+static int check_init_output_file(OutputFile *of, int file_index)
+{
+ int ret, i;
+
+ for (i = 0; i < of->ctx->nb_streams; i++) {
+ OutputStream *ost = output_streams[of->ost_index + i];
+ if (!ost->initialized)
+ return 0;
+ }
+
+ of->ctx->interrupt_callback = int_cb;
+
+ ret = avformat_write_header(of->ctx, &of->opts);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Could not write header for output file #%d "
+ "(incorrect codec parameters ?): %s\n",
+ file_index, av_err2str(ret));
+ return ret;
+ }
+ //assert_avoptions(of->opts);
+ of->header_written = 1;
+
+ av_dump_format(of->ctx, file_index, of->ctx->filename, 1);
+
+ if (sdp_filename || want_sdp)
+ print_sdp();
+
+ /* flush the muxing queues */
+ for (i = 0; i < of->ctx->nb_streams; i++) {
+ OutputStream *ost = output_streams[of->ost_index + i];
+
+ /* try to improve muxing time_base (only possible if nothing has been written yet) */
+ if (!av_fifo_size(ost->muxing_queue))
+ ost->mux_timebase = ost->st->time_base;
+
+ while (av_fifo_size(ost->muxing_queue)) {
+ AVPacket pkt;
+ av_fifo_generic_read(ost->muxing_queue, &pkt, sizeof(pkt), NULL);
+ write_packet(of, &pkt, ost);
+ }
+ }
+
+ return 0;
+}
+
+static int init_output_bsfs(OutputStream *ost)
+{
+ AVBSFContext *ctx;
+ int i, ret;
+
+ if (!ost->nb_bitstream_filters)
+ return 0;
+
+ for (i = 0; i < ost->nb_bitstream_filters; i++) {
+ ctx = ost->bsf_ctx[i];
+
+ ret = avcodec_parameters_copy(ctx->par_in,
+ i ? ost->bsf_ctx[i - 1]->par_out : ost->st->codecpar);
+ if (ret < 0)
+ return ret;
+
+ ctx->time_base_in = i ? ost->bsf_ctx[i - 1]->time_base_out : ost->st->time_base;
+
+ ret = av_bsf_init(ctx);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error initializing bitstream filter: %s\n",
+ ost->bsf_ctx[i]->filter->name);
+ return ret;
+ }
+ }
+
+ ctx = ost->bsf_ctx[ost->nb_bitstream_filters - 1];
+ ret = avcodec_parameters_copy(ost->st->codecpar, ctx->par_out);
+ if (ret < 0)
+ return ret;
+
+ ost->st->time_base = ctx->time_base_out;
+
+ return 0;
+}
+
+static int init_output_stream_streamcopy(OutputStream *ost)
+{
+ OutputFile *of = output_files[ost->file_index];
+ InputStream *ist = get_input_stream(ost);
+ AVCodecParameters *par_dst = ost->st->codecpar;
+ AVCodecParameters *par_src = ost->ref_par;
+ AVRational sar;
+ int i, ret;
+ uint32_t codec_tag = par_dst->codec_tag;
+
+ av_assert0(ist && !ost->filter);
+
+ ret = avcodec_parameters_to_context(ost->enc_ctx, ist->st->codecpar);
+ if (ret >= 0)
+ ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL,
+ "Error setting up codec context options.\n");
+ return ret;
+ }
+ avcodec_parameters_from_context(par_src, ost->enc_ctx);
+
+ if (!codec_tag) {
+ unsigned int codec_tag_tmp;
+ if (!of->ctx->oformat->codec_tag ||
+ av_codec_get_id (of->ctx->oformat->codec_tag, par_src->codec_tag) == par_src->codec_id ||
+ !av_codec_get_tag2(of->ctx->oformat->codec_tag, par_src->codec_id, &codec_tag_tmp))
+ codec_tag = par_src->codec_tag;
+ }
+
+ ret = avcodec_parameters_copy(par_dst, par_src);
+ if (ret < 0)
+ return ret;
+
+ par_dst->codec_tag = codec_tag;
+
+ if (!ost->frame_rate.num)
+ ost->frame_rate = ist->framerate;
+ ost->st->avg_frame_rate = ost->frame_rate;
+
+ ret = avformat_transfer_internal_stream_timing_info(of->ctx->oformat, ost->st, ist->st, copy_tb);
+ if (ret < 0)
+ return ret;
+
+ // copy timebase while removing common factors
+ if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
+ ost->st->time_base = av_add_q(av_stream_get_codec_timebase(ost->st), (AVRational){0, 1});
+
+ // copy estimated duration as a hint to the muxer
+ if (ost->st->duration <= 0 && ist->st->duration > 0)
+ ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base);
+
+ // copy disposition
+ ost->st->disposition = ist->st->disposition;
+
+ if (ist->st->nb_side_data) {
+ ost->st->side_data = av_realloc_array(NULL, ist->st->nb_side_data,
+ sizeof(*ist->st->side_data));
+ if (!ost->st->side_data)
+ return AVERROR(ENOMEM);
+
+ ost->st->nb_side_data = 0;
+ for (i = 0; i < ist->st->nb_side_data; i++) {
+ const AVPacketSideData *sd_src = &ist->st->side_data[i];
+ AVPacketSideData *sd_dst = &ost->st->side_data[ost->st->nb_side_data];
+
+ sd_dst->data = av_malloc(sd_src->size);
+ if (!sd_dst->data)
+ return AVERROR(ENOMEM);
+ memcpy(sd_dst->data, sd_src->data, sd_src->size);
+ sd_dst->size = sd_src->size;
+ sd_dst->type = sd_src->type;
+ ost->st->nb_side_data++;
+ }
+ }
+
+ if (ost->rotate_overridden) {
+ uint8_t *sd = av_stream_new_side_data(ost->st, AV_PKT_DATA_DISPLAYMATRIX,
+ sizeof(int32_t) * 9);
+ if (sd)
+ av_display_rotation_set((int32_t *)sd, -ost->rotate_override_value);
+ }
+
+ ost->parser = av_parser_init(par_dst->codec_id);
+ ost->parser_avctx = avcodec_alloc_context3(NULL);
+ if (!ost->parser_avctx)
+ return AVERROR(ENOMEM);
+
+ switch (par_dst->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ if (audio_volume != 256) {
+ av_log(NULL, AV_LOG_FATAL, "-acodec copy and -vol are incompatible (frames are not decoded)\n");
+ exit_program(1);
+ }
+ if((par_dst->block_align == 1 || par_dst->block_align == 1152 || par_dst->block_align == 576) && par_dst->codec_id == AV_CODEC_ID_MP3)
+ par_dst->block_align= 0;
+ if(par_dst->codec_id == AV_CODEC_ID_AC3)
+ par_dst->block_align= 0;
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option
+ sar =
+ av_mul_q(ost->frame_aspect_ratio,
+ (AVRational){ par_dst->height, par_dst->width });
+ av_log(NULL, AV_LOG_WARNING, "Overriding aspect ratio "
+ "with stream copy may produce invalid files\n");
+ }
+ else if (ist->st->sample_aspect_ratio.num)
+ sar = ist->st->sample_aspect_ratio;
+ else
+ sar = par_src->sample_aspect_ratio;
+ ost->st->sample_aspect_ratio = par_dst->sample_aspect_ratio = sar;
+ ost->st->avg_frame_rate = ist->st->avg_frame_rate;
+ ost->st->r_frame_rate = ist->st->r_frame_rate;
+ break;
+ }
+
+ ost->mux_timebase = ist->st->time_base;
+
+ return 0;
+}
+
+static void set_encoder_id(OutputFile *of, OutputStream *ost)
+{
+ AVDictionaryEntry *e;
+
+ uint8_t *encoder_string;
+ int encoder_string_len;
+ int format_flags = 0;
+ int codec_flags = 0;
+
+ if (av_dict_get(ost->st->metadata, "encoder", NULL, 0))
+ return;
+
+ e = av_dict_get(of->opts, "fflags", NULL, 0);
+ if (e) {
+ const AVOption *o = av_opt_find(of->ctx, "fflags", NULL, 0, 0);
+ if (!o)
+ return;
+ av_opt_eval_flags(of->ctx, o, e->value, &format_flags);
+ }
+ e = av_dict_get(ost->encoder_opts, "flags", NULL, 0);
+ if (e) {
+ const AVOption *o = av_opt_find(ost->enc_ctx, "flags", NULL, 0, 0);
+ if (!o)
+ return;
+ av_opt_eval_flags(ost->enc_ctx, o, e->value, &codec_flags);
+ }
+
+ encoder_string_len = sizeof(LIBAVCODEC_IDENT) + strlen(ost->enc->name) + 2;
+ encoder_string = av_mallocz(encoder_string_len);
+ if (!encoder_string)
+ exit_program(1);
+
+ if (!(format_flags & AVFMT_FLAG_BITEXACT) && !(codec_flags & AV_CODEC_FLAG_BITEXACT))
+ av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len);
+ else
+ av_strlcpy(encoder_string, "Lavc ", encoder_string_len);
+ av_strlcat(encoder_string, ost->enc->name, encoder_string_len);
+ av_dict_set(&ost->st->metadata, "encoder", encoder_string,
+ AV_DICT_DONT_STRDUP_VAL | AV_DICT_DONT_OVERWRITE);
+}
+
+static void parse_forced_key_frames(char *kf, OutputStream *ost,
+ AVCodecContext *avctx)
+{
+ char *p;
+ int n = 1, i, size, index = 0;
+ int64_t t, *pts;
+
+ for (p = kf; *p; p++)
+ if (*p == ',')
+ n++;
+ size = n;
+ pts = av_malloc_array(size, sizeof(*pts));
+ if (!pts) {
+ av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
+ exit_program(1);
+ }
+
+ p = kf;
+ for (i = 0; i < n; i++) {
+ char *next = strchr(p, ',');
+
+ if (next)
+ *next++ = 0;
+
+ if (!memcmp(p, "chapters", 8)) {
+
+ AVFormatContext *avf = output_files[ost->file_index]->ctx;
+ int j;
+
+ if (avf->nb_chapters > INT_MAX - size ||
+ !(pts = av_realloc_f(pts, size += avf->nb_chapters - 1,
+ sizeof(*pts)))) {
+ av_log(NULL, AV_LOG_FATAL,
+ "Could not allocate forced key frames array.\n");
+ exit_program(1);
+ }
+ t = p[8] ? parse_time_or_die("force_key_frames", p + 8, 1) : 0;
+ t = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
+
+ for (j = 0; j < avf->nb_chapters; j++) {
+ AVChapter *c = avf->chapters[j];
+ av_assert1(index < size);
+ pts[index++] = av_rescale_q(c->start, c->time_base,
+ avctx->time_base) + t;
+ }
+
+ } else {
+
+ t = parse_time_or_die("force_key_frames", p, 1);
+ av_assert1(index < size);
+ pts[index++] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
+
+ }
+
+ p = next;
+ }
+
+ av_assert0(index == size);
+ qsort(pts, size, sizeof(*pts), compare_int64);
+ ost->forced_kf_count = size;
+ ost->forced_kf_pts = pts;
+}
+
+static int init_output_stream_encode(OutputStream *ost)
+{
+ InputStream *ist = get_input_stream(ost);
+ AVCodecContext *enc_ctx = ost->enc_ctx;
+ AVCodecContext *dec_ctx = NULL;
+ AVFormatContext *oc = output_files[ost->file_index]->ctx;
+ int j, ret;
+
+ set_encoder_id(output_files[ost->file_index], ost);
+
+ // Muxers use AV_PKT_DATA_DISPLAYMATRIX to signal rotation. On the other
+ // hand, the legacy API makes demuxers set "rotate" metadata entries,
+ // which have to be filtered out to prevent leaking them to output files.
+ av_dict_set(&ost->st->metadata, "rotate", NULL, 0);
+
+ if (ist) {
+ ost->st->disposition = ist->st->disposition;
+
+ dec_ctx = ist->dec_ctx;
+
+ enc_ctx->chroma_sample_location = dec_ctx->chroma_sample_location;
+ } else {
+ for (j = 0; j < oc->nb_streams; j++) {
+ AVStream *st = oc->streams[j];
+ if (st != ost->st && st->codecpar->codec_type == ost->st->codecpar->codec_type)
+ break;
+ }
+ if (j == oc->nb_streams)
+ if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO ||
+ ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
+ ost->st->disposition = AV_DISPOSITION_DEFAULT;
+ }
+
+ if (enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (!ost->frame_rate.num)
+ ost->frame_rate = av_buffersink_get_frame_rate(ost->filter->filter);
+ if (ist && !ost->frame_rate.num)
+ ost->frame_rate = ist->framerate;
+ if (ist && !ost->frame_rate.num)
+ ost->frame_rate = ist->st->r_frame_rate;
+ if (ist && !ost->frame_rate.num) {
+ ost->frame_rate = (AVRational){25, 1};
+ av_log(NULL, AV_LOG_WARNING,
+ "No information "
+ "about the input framerate is available. Falling "
+ "back to a default value of 25fps for output stream #%d:%d. Use the -r option "
+ "if you want a different framerate.\n",
+ ost->file_index, ost->index);
+ }
+// ost->frame_rate = ist->st->avg_frame_rate.num ? ist->st->avg_frame_rate : (AVRational){25, 1};
+ if (ost->enc->supported_framerates && !ost->force_fps) {
+ int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
+ ost->frame_rate = ost->enc->supported_framerates[idx];
+ }
+ // reduce frame rate for mpeg4 to be within the spec limits
+ if (enc_ctx->codec_id == AV_CODEC_ID_MPEG4) {
+ av_reduce(&ost->frame_rate.num, &ost->frame_rate.den,
+ ost->frame_rate.num, ost->frame_rate.den, 65535);
+ }
+ }
+
+ switch (enc_ctx->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ enc_ctx->sample_fmt = av_buffersink_get_format(ost->filter->filter);
+ if (dec_ctx)
+ enc_ctx->bits_per_raw_sample = FFMIN(dec_ctx->bits_per_raw_sample,
+ av_get_bytes_per_sample(enc_ctx->sample_fmt) << 3);
+ enc_ctx->sample_rate = av_buffersink_get_sample_rate(ost->filter->filter);
+ enc_ctx->channel_layout = av_buffersink_get_channel_layout(ost->filter->filter);
+ enc_ctx->channels = av_buffersink_get_channels(ost->filter->filter);
+ enc_ctx->time_base = (AVRational){ 1, enc_ctx->sample_rate };
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ enc_ctx->time_base = av_inv_q(ost->frame_rate);
+ if (!(enc_ctx->time_base.num && enc_ctx->time_base.den))
+ enc_ctx->time_base = av_buffersink_get_time_base(ost->filter->filter);
+ if ( av_q2d(enc_ctx->time_base) < 0.001 && video_sync_method != VSYNC_PASSTHROUGH
+ && (video_sync_method == VSYNC_CFR || video_sync_method == VSYNC_VSCFR || (video_sync_method == VSYNC_AUTO && !(oc->oformat->flags & AVFMT_VARIABLE_FPS)))){
+ av_log(oc, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n"
+ "Please consider specifying a lower framerate, a different muxer or -vsync 2\n");
+ }
+ for (j = 0; j < ost->forced_kf_count; j++)
+ ost->forced_kf_pts[j] = av_rescale_q(ost->forced_kf_pts[j],
+ AV_TIME_BASE_Q,
+ enc_ctx->time_base);
+
+ enc_ctx->width = av_buffersink_get_w(ost->filter->filter);
+ enc_ctx->height = av_buffersink_get_h(ost->filter->filter);
+ enc_ctx->sample_aspect_ratio = ost->st->sample_aspect_ratio =
+ ost->frame_aspect_ratio.num ? // overridden by the -aspect cli option
+ av_mul_q(ost->frame_aspect_ratio, (AVRational){ enc_ctx->height, enc_ctx->width }) :
+ av_buffersink_get_sample_aspect_ratio(ost->filter->filter);
+ if (!strncmp(ost->enc->name, "libx264", 7) &&
+ enc_ctx->pix_fmt == AV_PIX_FMT_NONE &&
+ av_buffersink_get_format(ost->filter->filter) != AV_PIX_FMT_YUV420P)
+ av_log(NULL, AV_LOG_WARNING,
+ "No pixel format specified, %s for H.264 encoding chosen.\n"
+ "Use -pix_fmt yuv420p for compatibility with outdated media players.\n",
+ av_get_pix_fmt_name(av_buffersink_get_format(ost->filter->filter)));
+ if (!strncmp(ost->enc->name, "mpeg2video", 10) &&
+ enc_ctx->pix_fmt == AV_PIX_FMT_NONE &&
+ av_buffersink_get_format(ost->filter->filter) != AV_PIX_FMT_YUV420P)
+ av_log(NULL, AV_LOG_WARNING,
+ "No pixel format specified, %s for MPEG-2 encoding chosen.\n"
+ "Use -pix_fmt yuv420p for compatibility with outdated media players.\n",
+ av_get_pix_fmt_name(av_buffersink_get_format(ost->filter->filter)));
+ enc_ctx->pix_fmt = av_buffersink_get_format(ost->filter->filter);
+ if (dec_ctx)
+ enc_ctx->bits_per_raw_sample = FFMIN(dec_ctx->bits_per_raw_sample,
+ av_pix_fmt_desc_get(enc_ctx->pix_fmt)->comp[0].depth);
+
+ enc_ctx->framerate = ost->frame_rate;
+
+ ost->st->avg_frame_rate = ost->frame_rate;
+
+ if (!dec_ctx ||
+ enc_ctx->width != dec_ctx->width ||
+ enc_ctx->height != dec_ctx->height ||
+ enc_ctx->pix_fmt != dec_ctx->pix_fmt) {
+ enc_ctx->bits_per_raw_sample = frame_bits_per_raw_sample;
+ }
+
+ if (ost->forced_keyframes) {
+ if (!strncmp(ost->forced_keyframes, "expr:", 5)) {
+ ret = av_expr_parse(&ost->forced_keyframes_pexpr, ost->forced_keyframes+5,
+ forced_keyframes_const_names, NULL, NULL, NULL, NULL, 0, NULL);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Invalid force_key_frames expression '%s'\n", ost->forced_keyframes+5);
+ return ret;
+ }
+ ost->forced_keyframes_expr_const_values[FKF_N] = 0;
+ ost->forced_keyframes_expr_const_values[FKF_N_FORCED] = 0;
+ ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] = NAN;
+ ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] = NAN;
+
+ // Don't parse the 'forced_keyframes' in case of 'keep-source-keyframes',
+ // parse it only for static kf timings
+ } else if(strncmp(ost->forced_keyframes, "source", 6)) {
+ parse_forced_key_frames(ost->forced_keyframes, ost, ost->enc_ctx);
+ }
+ }
+ break;
+ case AVMEDIA_TYPE_SUBTITLE:
+ enc_ctx->time_base = AV_TIME_BASE_Q;
+ if (!enc_ctx->width) {
+ enc_ctx->width = input_streams[ost->source_index]->st->codecpar->width;
+ enc_ctx->height = input_streams[ost->source_index]->st->codecpar->height;
+ }
+ break;
+ case AVMEDIA_TYPE_DATA:
+ break;
+ default:
+ abort();
+ break;
+ }
+
+ ost->mux_timebase = enc_ctx->time_base;
+
+ return 0;
+}
+
+static int init_output_stream(OutputStream *ost, char *error, int error_len)
+{
+ int ret = 0;
+
+ if (ost->encoding_needed) {
+ AVCodec *codec = ost->enc;
+ AVCodecContext *dec = NULL;
+ InputStream *ist;
+
+ ret = init_output_stream_encode(ost);
+ if (ret < 0)
+ return ret;
+
+ if ((ist = get_input_stream(ost)))
+ dec = ist->dec_ctx;
+ if (dec && dec->subtitle_header) {
+ /* ASS code assumes this buffer is null terminated so add extra byte. */
+ ost->enc_ctx->subtitle_header = av_mallocz(dec->subtitle_header_size + 1);
+ if (!ost->enc_ctx->subtitle_header)
+ return AVERROR(ENOMEM);
+ memcpy(ost->enc_ctx->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
+ ost->enc_ctx->subtitle_header_size = dec->subtitle_header_size;
+ }
+ if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
+ av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
+ if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
+ !codec->defaults &&
+ !av_dict_get(ost->encoder_opts, "b", NULL, 0) &&
+ !av_dict_get(ost->encoder_opts, "ab", NULL, 0))
+ av_dict_set(&ost->encoder_opts, "b", "128000", 0);
+
+ if (ost->filter && av_buffersink_get_hw_frames_ctx(ost->filter->filter) &&
+ ((AVHWFramesContext*)av_buffersink_get_hw_frames_ctx(ost->filter->filter)->data)->format ==
+ av_buffersink_get_format(ost->filter->filter)) {
+ ost->enc_ctx->hw_frames_ctx = av_buffer_ref(av_buffersink_get_hw_frames_ctx(ost->filter->filter));
+ if (!ost->enc_ctx->hw_frames_ctx)
+ return AVERROR(ENOMEM);
+ }
+
+ if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
+ if (ret == AVERROR_EXPERIMENTAL)
+ abort_codec_experimental(codec, 1);
+ snprintf(error, error_len,
+ "Error while opening encoder for output stream #%d:%d - "
+ "maybe incorrect parameters such as bit_rate, rate, width or height",
+ ost->file_index, ost->index);
+ return ret;
+ }
+ if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
+ !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
+ av_buffersink_set_frame_size(ost->filter->filter,
+ ost->enc_ctx->frame_size);
+ assert_avoptions(ost->encoder_opts);
+ if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000)
+ av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
+ " It takes bits/s as argument, not kbits/s\n");
+
+ ret = avcodec_parameters_from_context(ost->st->codecpar, ost->enc_ctx);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL,
+ "Error initializing the output stream codec context.\n");
+ exit_program(1);
+ }
+ /*
+ * FIXME: ost->st->codec should't be needed here anymore.
+ */
+ ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);
+ if (ret < 0)
+ return ret;
+
+ if (ost->enc_ctx->nb_coded_side_data) {
+ int i;
+
+ ost->st->side_data = av_realloc_array(NULL, ost->enc_ctx->nb_coded_side_data,
+ sizeof(*ost->st->side_data));
+ if (!ost->st->side_data)
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < ost->enc_ctx->nb_coded_side_data; i++) {
+ const AVPacketSideData *sd_src = &ost->enc_ctx->coded_side_data[i];
+ AVPacketSideData *sd_dst = &ost->st->side_data[i];
+
+ sd_dst->data = av_malloc(sd_src->size);
+ if (!sd_dst->data)
+ return AVERROR(ENOMEM);
+ memcpy(sd_dst->data, sd_src->data, sd_src->size);
+ sd_dst->size = sd_src->size;
+ sd_dst->type = sd_src->type;
+ ost->st->nb_side_data++;
+ }
+ }
+
+ /*
+ * Add global input side data. For now this is naive, and copies it
+ * from the input stream's global side data. All side data should
+ * really be funneled over AVFrame and libavfilter, then added back to
+ * packet side data, and then potentially using the first packet for
+ * global side data.
+ */
+ if (ist) {
+ int i;
+ for (i = 0; i < ist->st->nb_side_data; i++) {
+ AVPacketSideData *sd = &ist->st->side_data[i];
+ uint8_t *dst = av_stream_new_side_data(ost->st, sd->type, sd->size);
+ if (!dst)
+ return AVERROR(ENOMEM);
+ memcpy(dst, sd->data, sd->size);
+ if (ist->autorotate && sd->type == AV_PKT_DATA_DISPLAYMATRIX)
+ av_display_rotation_set((uint32_t *)dst, 0);
+ }
+ }
+
+ // copy timebase while removing common factors
+ if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
+ ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
+
+ // copy estimated duration as a hint to the muxer
+ if (ost->st->duration <= 0 && ist && ist->st->duration > 0)
+ ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base);
+
+ ost->st->codec->codec= ost->enc_ctx->codec;
+ } else if (ost->stream_copy) {
+ ret = init_output_stream_streamcopy(ost);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * FIXME: will the codec context used by the parser during streamcopy
+ * This should go away with the new parser API.
+ */
+ ret = avcodec_parameters_to_context(ost->parser_avctx, ost->st->codecpar);
+ if (ret < 0)
+ return ret;
+ }
+
+ // parse user provided disposition, and update stream values
+ if (ost->disposition) {
+ static const AVOption opts[] = {
+ { "disposition" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
+ { "default" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEFAULT }, .unit = "flags" },
+ { "dub" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DUB }, .unit = "flags" },
+ { "original" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ORIGINAL }, .unit = "flags" },
+ { "comment" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_COMMENT }, .unit = "flags" },
+ { "lyrics" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_LYRICS }, .unit = "flags" },
+ { "karaoke" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_KARAOKE }, .unit = "flags" },
+ { "forced" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_FORCED }, .unit = "flags" },
+ { "hearing_impaired" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_HEARING_IMPAIRED }, .unit = "flags" },
+ { "visual_impaired" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_VISUAL_IMPAIRED }, .unit = "flags" },
+ { "clean_effects" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS }, .unit = "flags" },
+ { "captions" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, .unit = "flags" },
+ { "descriptions" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, .unit = "flags" },
+ { "metadata" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, .unit = "flags" },
+ { NULL },
+ };
+ static const AVClass class = {
+ .class_name = "",
+ .item_name = av_default_item_name,
+ .option = opts,
+ .version = LIBAVUTIL_VERSION_INT,
+ };
+ const AVClass *pclass = &class;
+
+ ret = av_opt_eval_flags(&pclass, &opts[0], ost->disposition, &ost->st->disposition);
+ if (ret < 0)
+ return ret;
+ }
+
+ /* initialize bitstream filters for the output stream
+ * needs to be done here, because the codec id for streamcopy is not
+ * known until now */
+ ret = init_output_bsfs(ost);
+ if (ret < 0)
+ return ret;
+
+ ost->initialized = 1;
+
+ ret = check_init_output_file(output_files[ost->file_index], ost->file_index);
+ if (ret < 0)
+ return ret;
+
+ return ret;
+}
+
+static void report_new_stream(int input_index, AVPacket *pkt)
+{
+ InputFile *file = input_files[input_index];
+ AVStream *st = file->ctx->streams[pkt->stream_index];
+
+ if (pkt->stream_index < file->nb_streams_warn)
+ return;
+ av_log(file->ctx, AV_LOG_WARNING,
+ "New %s stream %d:%d at pos:%"PRId64" and DTS:%ss\n",
+ av_get_media_type_string(st->codecpar->codec_type),
+ input_index, pkt->stream_index,
+ pkt->pos, av_ts2timestr(pkt->dts, &st->time_base));
+ file->nb_streams_warn = pkt->stream_index + 1;
+}
+
+static int transcode_init(void)
+{
+ int ret = 0, i, j, k;
+ AVFormatContext *oc;
+ OutputStream *ost;
+ InputStream *ist;
+ char error[1024] = {0};
+
+ for (i = 0; i < nb_filtergraphs; i++) {
+ FilterGraph *fg = filtergraphs[i];
+ for (j = 0; j < fg->nb_outputs; j++) {
+ OutputFilter *ofilter = fg->outputs[j];
+ if (!ofilter->ost || ofilter->ost->source_index >= 0)
+ continue;
+ if (fg->nb_inputs != 1)
+ continue;
+ for (k = nb_input_streams-1; k >= 0 ; k--)
+ if (fg->inputs[0]->ist == input_streams[k])
+ break;
+ ofilter->ost->source_index = k;
+ }
+ }
+
+ /* init framerate emulation */
+ for (i = 0; i < nb_input_files; i++) {
+ InputFile *ifile = input_files[i];
+ if (ifile->rate_emu)
+ for (j = 0; j < ifile->nb_streams; j++)
+ input_streams[j + ifile->ist_index]->start = av_gettime_relative();
+ }
+
+ /* init input streams */
+ for (i = 0; i < nb_input_streams; i++)
+ if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
+ for (i = 0; i < nb_output_streams; i++) {
+ ost = output_streams[i];
+ avcodec_close(ost->enc_ctx);
+ }
+ goto dump_format;
+ }
+
+ /* open each encoder */
+ for (i = 0; i < nb_output_streams; i++) {
+ // skip streams fed from filtergraphs until we have a frame for them
+ if (output_streams[i]->filter)
+ continue;
+
+ ret = init_output_stream(output_streams[i], error, sizeof(error));
+ if (ret < 0)
+ goto dump_format;
+ }
+
+ /* discard unused programs */
+ for (i = 0; i < nb_input_files; i++) {
+ InputFile *ifile = input_files[i];
+ for (j = 0; j < ifile->ctx->nb_programs; j++) {
+ AVProgram *p = ifile->ctx->programs[j];
+ int discard = AVDISCARD_ALL;
+
+ for (k = 0; k < p->nb_stream_indexes; k++)
+ if (!input_streams[ifile->ist_index + p->stream_index[k]]->discard) {
+ discard = AVDISCARD_DEFAULT;
+ break;
+ }
+ p->discard = discard;
+ }
+ }
+
+ /* write headers for files with no streams */
+ for (i = 0; i < nb_output_files; i++) {
+ oc = output_files[i]->ctx;
+ if (oc->oformat->flags & AVFMT_NOSTREAMS && oc->nb_streams == 0) {
+ ret = check_init_output_file(output_files[i], i);
+ if (ret < 0)
+ goto dump_format;
+ }
+ }
+
+ dump_format:
+ /* dump the stream mapping */
+ av_log(NULL, AV_LOG_INFO, "Stream mapping:\n");
+ for (i = 0; i < nb_input_streams; i++) {
+ ist = input_streams[i];
+
+ for (j = 0; j < ist->nb_filters; j++) {
+ if (!filtergraph_is_simple(ist->filters[j]->graph)) {
+ av_log(NULL, AV_LOG_INFO, " Stream #%d:%d (%s) -> %s",
+ ist->file_index, ist->st->index, ist->dec ? ist->dec->name : "?",
+ ist->filters[j]->name);
+ if (nb_filtergraphs > 1)
+ av_log(NULL, AV_LOG_INFO, " (graph %d)", ist->filters[j]->graph->index);
+ av_log(NULL, AV_LOG_INFO, "\n");
+ }
+ }
+ }
+
+ for (i = 0; i < nb_output_streams; i++) {
+ ost = output_streams[i];
+
+ if (ost->attachment_filename) {
+ /* an attached file */
+ av_log(NULL, AV_LOG_INFO, " File %s -> Stream #%d:%d\n",
+ ost->attachment_filename, ost->file_index, ost->index);
+ continue;
+ }
+
+ if (ost->filter && !filtergraph_is_simple(ost->filter->graph)) {
+ /* output from a complex graph */
+ av_log(NULL, AV_LOG_INFO, " %s", ost->filter->name);
+ if (nb_filtergraphs > 1)
+ av_log(NULL, AV_LOG_INFO, " (graph %d)", ost->filter->graph->index);
+
+ av_log(NULL, AV_LOG_INFO, " -> Stream #%d:%d (%s)\n", ost->file_index,
+ ost->index, ost->enc ? ost->enc->name : "?");
+ continue;
+ }
+
+ av_log(NULL, AV_LOG_INFO, " Stream #%d:%d -> #%d:%d",
+ input_streams[ost->source_index]->file_index,
+ input_streams[ost->source_index]->st->index,
+ ost->file_index,
+ ost->index);
+ if (ost->sync_ist != input_streams[ost->source_index])
+ av_log(NULL, AV_LOG_INFO, " [sync #%d:%d]",
+ ost->sync_ist->file_index,
+ ost->sync_ist->st->index);
+ if (ost->stream_copy)
+ av_log(NULL, AV_LOG_INFO, " (copy)");
+ else {
+ const AVCodec *in_codec = input_streams[ost->source_index]->dec;
+ const AVCodec *out_codec = ost->enc;
+ const char *decoder_name = "?";
+ const char *in_codec_name = "?";
+ const char *encoder_name = "?";
+ const char *out_codec_name = "?";
+ const AVCodecDescriptor *desc;
+
+ if (in_codec) {
+ decoder_name = in_codec->name;
+ desc = avcodec_descriptor_get(in_codec->id);
+ if (desc)
+ in_codec_name = desc->name;
+ if (!strcmp(decoder_name, in_codec_name))
+ decoder_name = "native";
+ }
+
+ if (out_codec) {
+ encoder_name = out_codec->name;
+ desc = avcodec_descriptor_get(out_codec->id);
+ if (desc)
+ out_codec_name = desc->name;
+ if (!strcmp(encoder_name, out_codec_name))
+ encoder_name = "native";
+ }
+
+ av_log(NULL, AV_LOG_INFO, " (%s (%s) -> %s (%s))",
+ in_codec_name, decoder_name,
+ out_codec_name, encoder_name);
+ }
+ av_log(NULL, AV_LOG_INFO, "\n");
+ }
+
+ if (ret) {
+ av_log(NULL, AV_LOG_ERROR, "%s\n", error);
+ return ret;
+ }
+
+ atomic_store(&transcode_init_done, 1);
+
+ return 0;
+}
+
+/* Return 1 if there remain streams where more output is wanted, 0 otherwise. */
+static int need_output(void)
+{
+ int i;
+
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+ OutputFile *of = output_files[ost->file_index];
+ AVFormatContext *os = output_files[ost->file_index]->ctx;
+
+ if (ost->finished ||
+ (os->pb && avio_tell(os->pb) >= of->limit_filesize))
+ continue;
+ if (ost->frame_number >= ost->max_frames) {
+ int j;
+ for (j = 0; j < of->ctx->nb_streams; j++)
+ close_output_stream(output_streams[of->ost_index + j]);
+ continue;
+ }
+
+ return 1;
+ }
+
+ return 0;
+}
+
+/**
+ * Select the output stream to process.
+ *
+ * @return selected output stream, or NULL if none available
+ */
+static OutputStream *choose_output(void)
+{
+ int i;
+ int64_t opts_min = INT64_MAX;
+ OutputStream *ost_min = NULL;
+
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+ int64_t opts = ost->st->cur_dts == AV_NOPTS_VALUE ? INT64_MIN :
+ av_rescale_q(ost->st->cur_dts, ost->st->time_base,
+ AV_TIME_BASE_Q);
+ if (ost->st->cur_dts == AV_NOPTS_VALUE)
+ av_log(NULL, AV_LOG_DEBUG, "cur_dts is invalid (this is harmless if it occurs once at the start per stream)\n");
+
+ if (!ost->initialized && !ost->inputs_done)
+ return ost;
+
+ if (!ost->finished && opts < opts_min) {
+ opts_min = opts;
+ ost_min = ost->unavailable ? NULL : ost;
+ }
+ }
+ return ost_min;
+}
+
+static void set_tty_echo(int on)
+{
+#if HAVE_TERMIOS_H
+ struct termios tty;
+ if (tcgetattr(0, &tty) == 0) {
+ if (on) tty.c_lflag |= ECHO;
+ else tty.c_lflag &= ~ECHO;
+ tcsetattr(0, TCSANOW, &tty);
+ }
+#endif
+}
+
+static int check_keyboard_interaction(int64_t cur_time)
+{
+ int i, ret, key;
+ static int64_t last_time;
+ if (received_nb_signals)
+ return AVERROR_EXIT;
+ /* read_key() returns 0 on EOF */
+ if(cur_time - last_time >= 100000 && !run_as_daemon){
+ key = read_key();
+ last_time = cur_time;
+ }else
+ key = -1;
+ if (key == 'q')
+ return AVERROR_EXIT;
+ if (key == '+') av_log_set_level(av_log_get_level()+10);
+ if (key == '-') av_log_set_level(av_log_get_level()-10);
+ if (key == 's') qp_hist ^= 1;
+ if (key == 'h'){
+ if (do_hex_dump){
+ do_hex_dump = do_pkt_dump = 0;
+ } else if(do_pkt_dump){
+ do_hex_dump = 1;
+ } else
+ do_pkt_dump = 1;
+ av_log_set_level(AV_LOG_DEBUG);
+ }
+ if (key == 'c' || key == 'C'){
+ char buf[4096], target[64], command[256], arg[256] = {0};
+ double time;
+ int k, n = 0;
+ fprintf(stderr, "\nEnter command: |all